package com.naze32.configurator;

import anywheresoftware.b4a.B4AMenuItem;
import android.app.Activity;
import android.os.Bundle;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.B4AActivity;
import anywheresoftware.b4a.ObjectWrapper;
import anywheresoftware.b4a.objects.ActivityWrapper;
import java.lang.reflect.InvocationTargetException;
import anywheresoftware.b4a.B4AUncaughtException;
import anywheresoftware.b4a.debug.*;
import java.lang.ref.WeakReference;

public class cli extends Activity implements B4AActivity{
	static cli mostCurrent;
	static boolean afterFirstLayout;
	static boolean isFirst = true;
    private static boolean processGlobalsRun = false;
	BALayout layout;
	public static BA processBA;
	BA activityBA;
    ActivityWrapper _activity;
    java.util.ArrayList<B4AMenuItem> menuItems;
	private static final boolean fullScreen = false;
	private static final boolean includeTitle = true;
    public static WeakReference<Activity> previousOne;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		if (isFirst) {
			processBA = new BA(this.getApplicationContext(), null, null, "com.naze32.configurator", "cli");
			processBA.loadHtSubs(this.getClass());
	        float deviceScale = getApplicationContext().getResources().getDisplayMetrics().density;
	        BALayout.setDeviceScale(deviceScale);
		}
		else if (previousOne != null) {
			Activity p = previousOne.get();
			if (p != null && p != this) {
                anywheresoftware.b4a.keywords.Common.Log("Killing previous instance (cli).");
				p.finish();
			}
		}
		if (!includeTitle) {
        	this.getWindow().requestFeature(android.view.Window.FEATURE_NO_TITLE);
        }
        if (fullScreen) {
        	getWindow().setFlags(android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN,   
        			android.view.WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
		mostCurrent = this;
        processBA.activityBA = null;
		layout = new BALayout(this);
		setContentView(layout);
		afterFirstLayout = false;
		BA.handler.postDelayed(new WaitForLayout(), 5);

	}
	private static class WaitForLayout implements Runnable {
		public void run() {
			if (afterFirstLayout)
				return;
			if (mostCurrent.layout.getWidth() == 0) {
				BA.handler.postDelayed(this, 5);
				return;
			}
			mostCurrent.layout.getLayoutParams().height = mostCurrent.layout.getHeight();
			mostCurrent.layout.getLayoutParams().width = mostCurrent.layout.getWidth();
			afterFirstLayout = true;
			mostCurrent.afterFirstLayout();
		}
	}
	private void afterFirstLayout() {
		activityBA = new BA(this, layout, processBA, "com.naze32.configurator", "cli");
        processBA.activityBA = new java.lang.ref.WeakReference<BA>(activityBA);
        _activity = new ActivityWrapper(activityBA, "activity");
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        initializeProcessGlobals();		
        initializeGlobals();
        anywheresoftware.b4a.objects.ViewWrapper.lastId = 0;
        anywheresoftware.b4a.keywords.Common.Log("** Activity (cli) Create, isFirst = " + isFirst + " **");
        processBA.raiseEvent2(null, true, "activity_create", false, isFirst);
		isFirst = false;
		if (mostCurrent == null || mostCurrent != this)
			return;
        processBA.setActivityPaused(false);
        anywheresoftware.b4a.keywords.Common.Log("** Activity (cli) Resume **");
        processBA.raiseEvent(null, "activity_resume");

	}
	public void addMenuItem(B4AMenuItem item) {
		if (menuItems == null)
			menuItems = new java.util.ArrayList<B4AMenuItem>();
		menuItems.add(item);
	}
	@Override
	public boolean onCreateOptionsMenu(android.view.Menu menu) {
		super.onCreateOptionsMenu(menu);
		if (menuItems == null)
			return false;
		for (B4AMenuItem bmi : menuItems) {
			android.view.MenuItem mi = menu.add(bmi.title);
			if (bmi.drawable != null)
				mi.setIcon(bmi.drawable);
			mi.setOnMenuItemClickListener(new B4AMenuItemsClickListener(bmi.eventName.toLowerCase(BA.cul)));
		}
		return true;
	}
	private class B4AMenuItemsClickListener implements android.view.MenuItem.OnMenuItemClickListener {
		private final String eventName;
		public B4AMenuItemsClickListener(String eventName) {
			this.eventName = eventName;
		}
		public boolean onMenuItemClick(android.view.MenuItem item) {
			processBA.raiseEvent(item.getTitle(), eventName + "_click");
			return true;
		}
	}
    public static Class<?> getObject() {
		return cli.class;
	}
    private Boolean onKeySubExist = null;
    private Boolean onKeyUpSubExist = null;
	@Override
	public boolean onKeyDown(int keyCode, android.view.KeyEvent event) {
		if (onKeySubExist == null)
			onKeySubExist = processBA.subExists("activity_keypress");
		if (onKeySubExist) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keypress", false, keyCode);
			if (res == null || res == true)
				return true;
		}
		return super.onKeyDown(keyCode, event);
	}
    @Override
	public boolean onKeyUp(int keyCode, android.view.KeyEvent event) {
		if (onKeyUpSubExist == null)
			onKeyUpSubExist = processBA.subExists("activity_keyup");
		if (onKeyUpSubExist) {
			Boolean res =  (Boolean)processBA.raiseEvent2(_activity, false, "activity_keyup", false, keyCode);
			if (res == null || res == true)
				return true;
		}
		return super.onKeyUp(keyCode, event);
	}
	@Override
	public void onNewIntent(android.content.Intent intent) {
		this.setIntent(intent);
	}
    @Override 
	public void onPause() {
		super.onPause();
        if (_activity == null) //workaround for emulator bug (Issue 2423)
            return;
		anywheresoftware.b4a.Msgbox.dismiss(true);
        anywheresoftware.b4a.keywords.Common.Log("** Activity (cli) Pause, UserClosed = " + activityBA.activity.isFinishing() + " **");
        processBA.raiseEvent2(_activity, true, "activity_pause", false, activityBA.activity.isFinishing());		
        processBA.setActivityPaused(true);
        mostCurrent = null;
        if (!activityBA.activity.isFinishing())
			previousOne = new WeakReference<Activity>(this);
        anywheresoftware.b4a.Msgbox.isDismissing = false;
	}

	@Override
	public void onDestroy() {
        super.onDestroy();
		previousOne = null;
	}
    @Override 
	public void onResume() {
		super.onResume();
        mostCurrent = this;
        anywheresoftware.b4a.Msgbox.isDismissing = false;
        if (activityBA != null) { //will be null during activity create (which waits for AfterLayout).
        	ResumeMessage rm = new ResumeMessage(mostCurrent);
        	BA.handler.post(rm);
        }
	}
    private static class ResumeMessage implements Runnable {
    	private final WeakReference<Activity> activity;
    	public ResumeMessage(Activity activity) {
    		this.activity = new WeakReference<Activity>(activity);
    	}
		public void run() {
			if (mostCurrent == null || mostCurrent != activity.get())
				return;
			processBA.setActivityPaused(false);
            anywheresoftware.b4a.keywords.Common.Log("** Activity (cli) Resume **");
		    processBA.raiseEvent(mostCurrent._activity, "activity_resume", (Object[])null);
		}
    }
	@Override
	protected void onActivityResult(int requestCode, int resultCode,
	      android.content.Intent data) {
		processBA.onActivityResult(requestCode, resultCode, data);
	}
	private static void initializeGlobals() {
		processBA.raiseEvent2(null, true, "globals", false, (Object[])null);
	}

public anywheresoftware.b4a.keywords.Common __c = null;
public static String _send_what = "";
public anywheresoftware.b4a.objects.CompoundButtonWrapper.ToggleButtonWrapper _yawdir = null;
public static boolean _cli_connected = false;
public anywheresoftware.b4a.objects.LabelWrapper _labels = null;
public anywheresoftware.b4a.objects.Timer _timer2 = null;
public anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper[] _checkboxes = null;
public static String[] _features = null;
public anywheresoftware.b4a.objects.ButtonWrapper _set_features = null;
public anywheresoftware.b4a.objects.PanelWrapper _vsv = null;
public anywheresoftware.b4a.objects.LabelWrapper _lbl2 = null;
public anywheresoftware.b4a.objects.SeekBarWrapper _sk1 = null;
public anywheresoftware.b4a.agraham.dialogs.InputDialog.CustomDialog _cd = null;
public static int _valor = 0;
public static int[] _sets = null;
public static int _cuantos = 0;
public anywheresoftware.b4a.objects.collections.List _set_label = null;
public anywheresoftware.b4a.objects.ButtonWrapper _rcsettings = null;
public static boolean[] _changed = null;
public anywheresoftware.b4a.objects.LabelWrapper[] _labeltext = null;
public anywheresoftware.b4a.objects.LabelWrapper[] _labelvalue = null;
public static int[] _maxs = null;
public static int[] _mins = null;
public static int _valor_minimo = 0;
public static int _valor_maximo = 0;
public anywheresoftware.b4a.objects.ButtonWrapper _vbat = null;
public anywheresoftware.b4a.objects.ButtonWrapper _read_again = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel_rc_settings = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel_vbat = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel_tri = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel_gimbal = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel_misc = null;
public anywheresoftware.b4a.objects.PanelWrapper _panel_baud = null;
public anywheresoftware.b4a.objects.ButtonWrapper _gimbal = null;
public anywheresoftware.b4a.objects.ButtonWrapper _tri = null;
public anywheresoftware.b4a.objects.ButtonWrapper _misc = null;
public anywheresoftware.b4a.objects.ButtonWrapper _baud = null;
public main _main = null;
public slidingpanels _slidingpanels = null;
public oscilo _oscilo = null;
public static String  _activity_create(boolean _firsttime) throws Exception{
int _i = 0;
 //BA.debugLineNum = 138;BA.debugLine="Sub Activity_Create(FirstTime As Boolean)";
 //BA.debugLineNum = 139;BA.debugLine="Activity.AddMenuItem(\"Close Cli\",\"close\")";
mostCurrent._activity.AddMenuItem("Close Cli","close");
 //BA.debugLineNum = 140;BA.debugLine="Activity.AddMenuItem(\"Save Data\",\"save\")";
mostCurrent._activity.AddMenuItem("Save Data","save");
 //BA.debugLineNum = 141;BA.debugLine="Activity.AddMenuItem(\"Read Data\",\"read\")";
mostCurrent._activity.AddMenuItem("Read Data","read");
 //BA.debugLineNum = 142;BA.debugLine="cuantos=0";
_cuantos = (int)(0);
 //BA.debugLineNum = 143;BA.debugLine="set_label.Initialize";
mostCurrent._set_label.Initialize();
 //BA.debugLineNum = 144;BA.debugLine="set_label.AddAll( Array As String (\"Deadband\",\"yaw Deadband\",\"mid RC\", \"min Throttle\", \"max Throttle\", \"min Command\",\"min Check\",\"max Check\",\"motor_pwm_rate\", \"servo_pwm_rate\",\"spektrum_hires\", \"vbat scale\", \"vbat max cell voltage\",\"vbat min cell voltage\", \"yaw_direction\",\"wing_left_mid\",\"wing_right_mid\",\"tri_yaw_middle\",\"tri_yaw_min\",\"tri_yaw_max\",\"gimbal_flags\",\"gimbal_pitch_gain\",\"gimbal_roll_gain\",\"gimbal_pitch_min\",\"gimbal_pitch_max\",\"gimbal_pitch_mid\",\"gimbal_roll_min\",\"gimbal_roll_max\",\"gimbal_roll_mid\", \"acc_lpf_factor\", \"gps_baudrate\",\"serial_baudrate\"))";
mostCurrent._set_label.AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new String[]{"Deadband","yaw Deadband","mid RC","min Throttle","max Throttle","min Command","min Check","max Check","motor_pwm_rate","servo_pwm_rate","spektrum_hires","vbat scale","vbat max cell voltage","vbat min cell voltage","yaw_direction","wing_left_mid","wing_right_mid","tri_yaw_middle","tri_yaw_min","tri_yaw_max","gimbal_flags","gimbal_pitch_gain","gimbal_roll_gain","gimbal_pitch_min","gimbal_pitch_max","gimbal_pitch_mid","gimbal_roll_min","gimbal_roll_max","gimbal_roll_mid","acc_lpf_factor","gps_baudrate","serial_baudrate"}));
 //BA.debugLineNum = 146;BA.debugLine="For i=0 To changed.Length-1";
{
final double step51 = 1;
final double limit51 = (int)(_changed.length-1);
for (_i = (int)(0); (step51 > 0 && _i <= limit51) || (step51 < 0 && _i >= limit51); _i += step51) {
 //BA.debugLineNum = 147;BA.debugLine="changed(i)=False";
_changed[_i] = anywheresoftware.b4a.keywords.Common.False;
 }
};
 //BA.debugLineNum = 150;BA.debugLine="vsv.Initialize(\"\")";
mostCurrent._vsv.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 151;BA.debugLine="labels.Initialize(\"\")";
mostCurrent._labels.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 152;BA.debugLine="For i=0 To 9";
{
final double step56 = 1;
final double limit56 = (int)(9);
for (_i = (int)(0); (step56 > 0 && _i <= limit56) || (step56 < 0 && _i >= limit56); _i += step56) {
 //BA.debugLineNum = 153;BA.debugLine="If i<5 Then";
if (_i<5) { 
 //BA.debugLineNum = 154;BA.debugLine="labels.Initialize(\"\")";
mostCurrent._labels.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 155;BA.debugLine="vsv.AddView(labels,5%x,5%y + i*(10%y),30%x,10%y)";
mostCurrent._vsv.AddView((android.view.View)(mostCurrent._labels.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(5),mostCurrent.activityBA)+_i*(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA))),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 156;BA.debugLine="labels.Text=features(i)";
mostCurrent._labels.setText((Object)(mostCurrent._features[_i]));
 //BA.debugLineNum = 157;BA.debugLine="labels.Left=5%x";
mostCurrent._labels.setLeft(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA));
 //BA.debugLineNum = 158;BA.debugLine="labels.Gravity=Bit.Or(Gravity.LEFT,Gravity.CENTER_VERTICAL)";
mostCurrent._labels.setGravity(anywheresoftware.b4a.keywords.Common.Bit.Or(anywheresoftware.b4a.keywords.Common.Gravity.LEFT,anywheresoftware.b4a.keywords.Common.Gravity.CENTER_VERTICAL));
 //BA.debugLineNum = 159;BA.debugLine="checkboxes(i).Initialize(\"\")";
mostCurrent._checkboxes[_i].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 160;BA.debugLine="vsv.AddView(checkboxes(i),labels.width + 10%x , 5%y + i*(10%y) ,50dip, 10%y)";
mostCurrent._vsv.AddView((android.view.View)(mostCurrent._checkboxes[_i].getObject()),(int)(mostCurrent._labels.getWidth()+anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(10),mostCurrent.activityBA)),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(5),mostCurrent.activityBA)+_i*(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA))),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 }else {
 //BA.debugLineNum = 162;BA.debugLine="labels.Initialize(\"\")";
mostCurrent._labels.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 163;BA.debugLine="vsv.AddView(labels,70%x,5%y + (i-5)*(10%y),30%x,10%y)";
mostCurrent._vsv.AddView((android.view.View)(mostCurrent._labels.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(70),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(5),mostCurrent.activityBA)+(_i-5)*(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA))),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 164;BA.debugLine="labels.Text=features(i)";
mostCurrent._labels.setText((Object)(mostCurrent._features[_i]));
 //BA.debugLineNum = 166;BA.debugLine="labels.Gravity=Bit.Or(Gravity.LEFT,Gravity.CENTER_VERTICAL)";
mostCurrent._labels.setGravity(anywheresoftware.b4a.keywords.Common.Bit.Or(anywheresoftware.b4a.keywords.Common.Gravity.LEFT,anywheresoftware.b4a.keywords.Common.Gravity.CENTER_VERTICAL));
 //BA.debugLineNum = 167;BA.debugLine="checkboxes(i).Initialize(\"\")";
mostCurrent._checkboxes[_i].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 168;BA.debugLine="vsv.AddView(checkboxes(i),55%x , 5%y + (i-5)*(10%y) ,50dip, 10%y)";
mostCurrent._vsv.AddView((android.view.View)(mostCurrent._checkboxes[_i].getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(55),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(5),mostCurrent.activityBA)+(_i-5)*(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA))),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 };
 }
};
 //BA.debugLineNum = 172;BA.debugLine="rcsettings.Initialize(\"rcsettings\")";
mostCurrent._rcsettings.Initialize(mostCurrent.activityBA,"rcsettings");
 //BA.debugLineNum = 173;BA.debugLine="Activity.AddView(rcsettings,0%x,60%y,30%x,50dip)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._rcsettings.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(60),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)));
 //BA.debugLineNum = 174;BA.debugLine="rcsettings.Text=\"RC settings\"";
mostCurrent._rcsettings.setText((Object)("RC settings"));
 //BA.debugLineNum = 175;BA.debugLine="rcsettings.Enabled=True";
mostCurrent._rcsettings.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 177;BA.debugLine="vbat.Initialize(\"vbat\")";
mostCurrent._vbat.Initialize(mostCurrent.activityBA,"vbat");
 //BA.debugLineNum = 178;BA.debugLine="Activity.AddView(vbat,35%x,60%y,30%x,50dip)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._vbat.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(35),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(60),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)));
 //BA.debugLineNum = 179;BA.debugLine="vbat.Text=\"Batterie Settings\"";
mostCurrent._vbat.setText((Object)("Batterie Settings"));
 //BA.debugLineNum = 180;BA.debugLine="vbat.Enabled=True";
mostCurrent._vbat.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 182;BA.debugLine="tri.Initialize(\"Tri\")";
mostCurrent._tri.Initialize(mostCurrent.activityBA,"Tri");
 //BA.debugLineNum = 183;BA.debugLine="Activity.AddView(tri,70%x,60%y,30%x,50dip)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._tri.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(70),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(60),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)));
 //BA.debugLineNum = 184;BA.debugLine="tri.Text=\"Tri/Wing Settings\"";
mostCurrent._tri.setText((Object)("Tri/Wing Settings"));
 //BA.debugLineNum = 185;BA.debugLine="tri.Enabled=True";
mostCurrent._tri.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 187;BA.debugLine="gimbal.Initialize(\"gimbal\")";
mostCurrent._gimbal.Initialize(mostCurrent.activityBA,"gimbal");
 //BA.debugLineNum = 188;BA.debugLine="Activity.AddView(gimbal,0%x,75%y,30%x,50dip)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._gimbal.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(75),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)));
 //BA.debugLineNum = 189;BA.debugLine="gimbal.Text=\"Gimbal Settings\"";
mostCurrent._gimbal.setText((Object)("Gimbal Settings"));
 //BA.debugLineNum = 190;BA.debugLine="gimbal.Enabled=True";
mostCurrent._gimbal.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 192;BA.debugLine="Misc.Initialize(\"misc\")";
mostCurrent._misc.Initialize(mostCurrent.activityBA,"misc");
 //BA.debugLineNum = 193;BA.debugLine="Activity.AddView(Misc,35%x,75%y,30%x,50dip)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._misc.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(35),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(75),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)));
 //BA.debugLineNum = 194;BA.debugLine="Misc.Text=\"Misc Settings\"";
mostCurrent._misc.setText((Object)("Misc Settings"));
 //BA.debugLineNum = 195;BA.debugLine="Misc.Enabled=True";
mostCurrent._misc.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 197;BA.debugLine="Baud.Initialize(\"baud\")";
mostCurrent._baud.Initialize(mostCurrent.activityBA,"baud");
 //BA.debugLineNum = 198;BA.debugLine="Activity.AddView(Baud,70%x,75%y,30%x,50dip)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._baud.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(70),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(75),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)));
 //BA.debugLineNum = 199;BA.debugLine="Baud.Text=\"Baud Settings\"";
mostCurrent._baud.setText((Object)("Baud Settings"));
 //BA.debugLineNum = 200;BA.debugLine="Baud.Enabled=True";
mostCurrent._baud.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 203;BA.debugLine="Activity.AddView(vsv,0%x,0%y,100%x,90%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._vsv.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(90),mostCurrent.activityBA));
 //BA.debugLineNum = 204;BA.debugLine="Set_Features.Initialize(\"Set_Features\")";
mostCurrent._set_features.Initialize(mostCurrent.activityBA,"Set_Features");
 //BA.debugLineNum = 205;BA.debugLine="Activity.AddView(Set_Features, 0%x,90%y,20%x,10%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._set_features.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(90),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(20),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 206;BA.debugLine="Set_Features.Text=\"Set\"";
mostCurrent._set_features.setText((Object)("Set"));
 //BA.debugLineNum = 207;BA.debugLine="Set_Features.Left=Activity.Width/2-Set_Features.Width/2";
mostCurrent._set_features.setLeft((int)(mostCurrent._activity.getWidth()/(double)2-mostCurrent._set_features.getWidth()/(double)2));
 //BA.debugLineNum = 209;BA.debugLine="read_again.Initialize(\"read_again\")";
mostCurrent._read_again.Initialize(mostCurrent.activityBA,"read_again");
 //BA.debugLineNum = 210;BA.debugLine="Activity.AddView(read_again, 0%x,90%y,20%x,10%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._read_again.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(90),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(20),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 211;BA.debugLine="read_again.Text=\"Read\"";
mostCurrent._read_again.setText((Object)("Read"));
 //BA.debugLineNum = 212;BA.debugLine="read_again.Left=100%x-read_again.width";
mostCurrent._read_again.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA)-mostCurrent._read_again.getWidth()));
 //BA.debugLineNum = 215;BA.debugLine="data";
_data();
 //BA.debugLineNum = 217;BA.debugLine="For i=0 To labelvalue.Length-1";
{
final double step108 = 1;
final double limit108 = (int)(mostCurrent._labelvalue.length-1);
for (_i = (int)(0); (step108 > 0 && _i <= limit108) || (step108 < 0 && _i >= limit108); _i += step108) {
 //BA.debugLineNum = 218;BA.debugLine="labelvalue(i).Initialize(\"\")";
mostCurrent._labelvalue[_i].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 219;BA.debugLine="labeltext(i).Initialize(\"\")";
mostCurrent._labeltext[_i].Initialize(mostCurrent.activityBA,"");
 }
};
 //BA.debugLineNum = 221;BA.debugLine="End Sub";
return "";
}
public static String  _activity_pause(boolean _userclosed) throws Exception{
char[] _junk = null;
 //BA.debugLineNum = 864;BA.debugLine="Sub Activity_Pause (UserClosed As Boolean)";
 //BA.debugLineNum = 865;BA.debugLine="If Main.connected=True Then";
if (mostCurrent._main._connected==anywheresoftware.b4a.keywords.Common.True) { 
 //BA.debugLineNum = 866;BA.debugLine="Set_Features_Click";
_set_features_click();
 //BA.debugLineNum = 867;BA.debugLine="Main.TextWriter1.Write(\"exit\" & CRLF)";
mostCurrent._main._textwriter1.Write("exit"+anywheresoftware.b4a.keywords.Common.CRLF);
 //BA.debugLineNum = 868;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 //BA.debugLineNum = 869;BA.debugLine="Dim junk(1000) As Char";
_junk = new char[(int)(1000)];
;
 //BA.debugLineNum = 870;BA.debugLine="Main.TextReader1.read(junk,0,junk.length)";
mostCurrent._main._textreader1.Read(_junk,(int)(0),_junk.length);
 //BA.debugLineNum = 876;BA.debugLine="Main.return_from_cli=True";
mostCurrent._main._return_from_cli = anywheresoftware.b4a.keywords.Common.True;
 };
 //BA.debugLineNum = 878;BA.debugLine="StartActivity(Main)";
anywheresoftware.b4a.keywords.Common.StartActivity(mostCurrent.activityBA,(Object)(mostCurrent._main.getObject()));
 //BA.debugLineNum = 879;BA.debugLine="Activity.Finish";
mostCurrent._activity.Finish();
 //BA.debugLineNum = 880;BA.debugLine="End Sub";
return "";
}
public static String  _activity_resume() throws Exception{
 //BA.debugLineNum = 860;BA.debugLine="Sub Activity_Resume";
 //BA.debugLineNum = 862;BA.debugLine="End Sub";
return "";
}
public static String  _baud_click() throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
anywheresoftware.b4a.objects.SpinnerWrapper[] _spinners = null;
int _i = 0;
int _j = 0;
anywheresoftware.b4a.objects.ButtonWrapper _cerrar6 = null;
 //BA.debugLineNum = 521;BA.debugLine="Sub baud_Click()";
 //BA.debugLineNum = 522;BA.debugLine="deshabilitar";
_deshabilitar();
 //BA.debugLineNum = 523;BA.debugLine="panel_baud.Initialize(\"\")";
mostCurrent._panel_baud.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 524;BA.debugLine="Activity.addview(panel_baud,0%x, 0%y, 100%x, 100%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._panel_baud.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(100),mostCurrent.activityBA));
 //BA.debugLineNum = 525;BA.debugLine="Dim titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 526;BA.debugLine="Dim spinners(2) As Spinner";
_spinners = new anywheresoftware.b4a.objects.SpinnerWrapper[(int)(2)];
{
int d0 = _spinners.length;
for (int i0 = 0;i0 < d0;i0++) {
_spinners[i0] = new anywheresoftware.b4a.objects.SpinnerWrapper();
}
}
;
 //BA.debugLineNum = 527;BA.debugLine="spinners(0).Initialize(\"spinners\")";
_spinners[(int)(0)].Initialize(mostCurrent.activityBA,"spinners");
 //BA.debugLineNum = 528;BA.debugLine="spinners(1).Initialize(\"spinners\")";
_spinners[(int)(1)].Initialize(mostCurrent.activityBA,"spinners");
 //BA.debugLineNum = 529;BA.debugLine="spinners(0).AddAll(Array As Int(1200,9600,14400,19200,38400,56000,57600,115200))";
_spinners[(int)(0)].AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new int[]{(int)(1200),(int)(9600),(int)(14400),(int)(19200),(int)(38400),(int)(56000),(int)(57600),(int)(115200)}));
 //BA.debugLineNum = 530;BA.debugLine="spinners(1).AddAll(Array As Int(1200,9600,14400,19200,38400,56000,57600,115200))";
_spinners[(int)(1)].AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(new int[]{(int)(1200),(int)(9600),(int)(14400),(int)(19200),(int)(38400),(int)(56000),(int)(57600),(int)(115200)}));
 //BA.debugLineNum = 531;BA.debugLine="titulo.Initialize(\"\")";
_titulo.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 532;BA.debugLine="titulo.text= \"Baud Settings\"";
_titulo.setText((Object)("Baud Settings"));
 //BA.debugLineNum = 533;BA.debugLine="titulo.TextSize=18";
_titulo.setTextSize((float)(18));
 //BA.debugLineNum = 534;BA.debugLine="titulo.gravity=Gravity.CENTER";
_titulo.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 535;BA.debugLine="panel_baud.AddView(titulo, 50%x,0%y, 100%x,10%y)";
mostCurrent._panel_baud.AddView((android.view.View)(_titulo.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 536;BA.debugLine="titulo.Left=50%x-titulo.Width/2";
_titulo.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_titulo.getWidth()/(double)2));
 //BA.debugLineNum = 537;BA.debugLine="panel_baud.Color=Colors.ARGB(255,0,0,0)";
mostCurrent._panel_baud.setColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int)(255),(int)(0),(int)(0),(int)(0)));
 //BA.debugLineNum = 538;BA.debugLine="For i=0 To 1";
{
final double step398 = 1;
final double limit398 = (int)(1);
for (_i = (int)(0); (step398 > 0 && _i <= limit398) || (step398 < 0 && _i >= limit398); _i += step398) {
 //BA.debugLineNum = 539;BA.debugLine="labeltext(i).Initialize(\"\")";
mostCurrent._labeltext[_i].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 540;BA.debugLine="labeltext(i).Text=set_label.Get(i+30)";
mostCurrent._labeltext[_i].setText(mostCurrent._set_label.Get((int)(_i+30)));
 //BA.debugLineNum = 541;BA.debugLine="labeltext(i).Gravity=Gravity.CENTER";
mostCurrent._labeltext[_i].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 543;BA.debugLine="For j=0 To spinners(i).Size-1";
{
final double step402 = 1;
final double limit402 = (int)(_spinners[_i].getSize()-1);
for (_j = (int)(0); (step402 > 0 && _j <= limit402) || (step402 < 0 && _j >= limit402); _j += step402) {
 //BA.debugLineNum = 544;BA.debugLine="If spinners(i).GetItem(j)=sets(30+i) Then";
if ((_spinners[_i].GetItem(_j)).equals(BA.NumberToString(_sets[(int)(30+_i)]))) { 
 //BA.debugLineNum = 545;BA.debugLine="spinners(i).SelectedIndex=j";
_spinners[_i].setSelectedIndex(_j);
 };
 }
};
 //BA.debugLineNum = 548;BA.debugLine="spinners(i).Tag=set_label.get(i+30)";
_spinners[_i].setTag(mostCurrent._set_label.Get((int)(_i+30)));
 //BA.debugLineNum = 550;BA.debugLine="panel_baud.AddView(labeltext(i),5%x, 10%y+i*10%y,30%x,40dip)";
mostCurrent._panel_baud.AddView((android.view.View)(mostCurrent._labeltext[_i].getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 551;BA.debugLine="panel_baud.AddView(spinners(i),10%x+labeltext(i).Width, 10%y+i*10%y,40%x,40dip)";
mostCurrent._panel_baud.AddView((android.view.View)(_spinners[_i].getObject()),(int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(10),mostCurrent.activityBA)+mostCurrent._labeltext[_i].getWidth()),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(40),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 }
};
 //BA.debugLineNum = 554;BA.debugLine="Dim cerrar6 As Button";
_cerrar6 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 555;BA.debugLine="cerrar6.Initialize(\"cerrar6\")";
_cerrar6.Initialize(mostCurrent.activityBA,"cerrar6");
 //BA.debugLineNum = 556;BA.debugLine="cerrar6.Text=\"Close\"";
_cerrar6.setText((Object)("Close"));
 //BA.debugLineNum = 557;BA.debugLine="panel_baud.AddView(cerrar6,50%x,90%y,100dip,40dip)";
mostCurrent._panel_baud.AddView((android.view.View)(_cerrar6.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(90),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(100)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 558;BA.debugLine="cerrar6.Left=50%x-cerrar6.Width/2";
_cerrar6.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_cerrar6.getWidth()/(double)2));
 //BA.debugLineNum = 559;BA.debugLine="cerrar6.Gravity=Gravity.CENTER";
_cerrar6.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 561;BA.debugLine="End Sub";
return "";
}
public static String  _cerrar_click() throws Exception{
 //BA.debugLineNum = 585;BA.debugLine="Sub cerrar_Click";
 //BA.debugLineNum = 586;BA.debugLine="panel_rc_settings.RemoveView";
mostCurrent._panel_rc_settings.RemoveView();
 //BA.debugLineNum = 587;BA.debugLine="habilitar";
_habilitar();
 //BA.debugLineNum = 588;BA.debugLine="End Sub";
return "";
}
public static String  _cerrar2_click() throws Exception{
 //BA.debugLineNum = 589;BA.debugLine="Sub cerrar2_Click";
 //BA.debugLineNum = 590;BA.debugLine="panel_vbat.RemoveView";
mostCurrent._panel_vbat.RemoveView();
 //BA.debugLineNum = 591;BA.debugLine="habilitar";
_habilitar();
 //BA.debugLineNum = 592;BA.debugLine="End Sub";
return "";
}
public static String  _cerrar3_click() throws Exception{
 //BA.debugLineNum = 593;BA.debugLine="Sub cerrar3_Click";
 //BA.debugLineNum = 594;BA.debugLine="panel_tri.RemoveView";
mostCurrent._panel_tri.RemoveView();
 //BA.debugLineNum = 595;BA.debugLine="habilitar";
_habilitar();
 //BA.debugLineNum = 596;BA.debugLine="End Sub";
return "";
}
public static String  _cerrar4_click() throws Exception{
 //BA.debugLineNum = 597;BA.debugLine="Sub cerrar4_Click";
 //BA.debugLineNum = 598;BA.debugLine="panel_gimbal.RemoveView";
mostCurrent._panel_gimbal.RemoveView();
 //BA.debugLineNum = 599;BA.debugLine="habilitar";
_habilitar();
 //BA.debugLineNum = 600;BA.debugLine="End Sub";
return "";
}
public static String  _cerrar5_click() throws Exception{
 //BA.debugLineNum = 601;BA.debugLine="Sub cerrar5_Click";
 //BA.debugLineNum = 602;BA.debugLine="panel_misc.RemoveView";
mostCurrent._panel_misc.RemoveView();
 //BA.debugLineNum = 603;BA.debugLine="habilitar";
_habilitar();
 //BA.debugLineNum = 604;BA.debugLine="End Sub";
return "";
}
public static String  _cerrar6_click() throws Exception{
 //BA.debugLineNum = 605;BA.debugLine="Sub cerrar6_Click";
 //BA.debugLineNum = 606;BA.debugLine="panel_baud.RemoveView";
mostCurrent._panel_baud.RemoveView();
 //BA.debugLineNum = 607;BA.debugLine="habilitar";
_habilitar();
 //BA.debugLineNum = 608;BA.debugLine="End Sub";
return "";
}
public static String  _close_click() throws Exception{
 //BA.debugLineNum = 785;BA.debugLine="Sub close_click()";
 //BA.debugLineNum = 786;BA.debugLine="Activity_Pause(True)";
_activity_pause(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 787;BA.debugLine="End Sub";
return "";
}
public static String  _data() throws Exception{
long _ti = 0L;
 //BA.debugLineNum = 615;BA.debugLine="Sub data";
 //BA.debugLineNum = 616;BA.debugLine="If Main.connected Then";
if (mostCurrent._main._connected) { 
 //BA.debugLineNum = 617;BA.debugLine="If cli_connected=False Then";
if (_cli_connected==anywheresoftware.b4a.keywords.Common.False) { 
 //BA.debugLineNum = 618;BA.debugLine="timer2.Enabled=True";
mostCurrent._timer2.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 619;BA.debugLine="Main.TextWriter1.Write(\"#\")";
mostCurrent._main._textwriter1.Write("#");
 //BA.debugLineNum = 620;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 //BA.debugLineNum = 621;BA.debugLine="cli_connected=True";
_cli_connected = anywheresoftware.b4a.keywords.Common.True;
 //BA.debugLineNum = 622;BA.debugLine="send_what=\"start\"";
_send_what = "start";
 //BA.debugLineNum = 623;BA.debugLine="Dim Ti As Long";
_ti = 0L;
 //BA.debugLineNum = 624;BA.debugLine="Ti = DateTime.Now + (200)";
_ti = (long)(anywheresoftware.b4a.keywords.Common.DateTime.getNow()+(200));
 //BA.debugLineNum = 625;BA.debugLine="Do While DateTime.Now < Ti";
while (anywheresoftware.b4a.keywords.Common.DateTime.getNow()<_ti) {
 //BA.debugLineNum = 626;BA.debugLine="DoEvents";
anywheresoftware.b4a.keywords.Common.DoEvents();
 }
;
 //BA.debugLineNum = 628;BA.debugLine="Timer2_Tick";
_timer2_tick();
 //BA.debugLineNum = 629;BA.debugLine="Main.TextWriter1.Write(\"feature\" & CRLF)";
mostCurrent._main._textwriter1.Write("feature"+anywheresoftware.b4a.keywords.Common.CRLF);
 //BA.debugLineNum = 630;BA.debugLine="send_what=\"feature\"";
_send_what = "feature";
 //BA.debugLineNum = 631;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 //BA.debugLineNum = 632;BA.debugLine="Ti = DateTime.Now + (400)";
_ti = (long)(anywheresoftware.b4a.keywords.Common.DateTime.getNow()+(400));
 //BA.debugLineNum = 633;BA.debugLine="Do While DateTime.Now < Ti";
while (anywheresoftware.b4a.keywords.Common.DateTime.getNow()<_ti) {
 //BA.debugLineNum = 634;BA.debugLine="DoEvents";
anywheresoftware.b4a.keywords.Common.DoEvents();
 }
;
 //BA.debugLineNum = 636;BA.debugLine="Timer2_Tick";
_timer2_tick();
 //BA.debugLineNum = 637;BA.debugLine="Main.Textwriter1.Write(\"set\" & CRLF)";
mostCurrent._main._textwriter1.Write("set"+anywheresoftware.b4a.keywords.Common.CRLF);
 //BA.debugLineNum = 638;BA.debugLine="send_what=\"set\"";
_send_what = "set";
 //BA.debugLineNum = 639;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 //BA.debugLineNum = 640;BA.debugLine="Timer2_Tick";
_timer2_tick();
 }else {
 //BA.debugLineNum = 643;BA.debugLine="Main.TextWriter1.Write(\"feature\" & CRLF)";
mostCurrent._main._textwriter1.Write("feature"+anywheresoftware.b4a.keywords.Common.CRLF);
 //BA.debugLineNum = 644;BA.debugLine="send_what=\"feature\"";
_send_what = "feature";
 //BA.debugLineNum = 645;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 //BA.debugLineNum = 646;BA.debugLine="Ti = DateTime.Now + (400)";
_ti = (long)(anywheresoftware.b4a.keywords.Common.DateTime.getNow()+(400));
 //BA.debugLineNum = 647;BA.debugLine="Do While DateTime.Now < Ti";
while (anywheresoftware.b4a.keywords.Common.DateTime.getNow()<_ti) {
 //BA.debugLineNum = 648;BA.debugLine="DoEvents";
anywheresoftware.b4a.keywords.Common.DoEvents();
 }
;
 //BA.debugLineNum = 650;BA.debugLine="Timer2_Tick";
_timer2_tick();
 //BA.debugLineNum = 651;BA.debugLine="Main.Textwriter1.Write(\"set\" & CRLF)";
mostCurrent._main._textwriter1.Write("set"+anywheresoftware.b4a.keywords.Common.CRLF);
 //BA.debugLineNum = 652;BA.debugLine="send_what=\"set\"";
_send_what = "set";
 //BA.debugLineNum = 653;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 //BA.debugLineNum = 654;BA.debugLine="Timer2_Tick";
_timer2_tick();
 };
 };
 //BA.debugLineNum = 659;BA.debugLine="End Sub";
return "";
}
public static String  _deshabilitar() throws Exception{
 //BA.debugLineNum = 574;BA.debugLine="Sub deshabilitar";
 //BA.debugLineNum = 575;BA.debugLine="rcsettings.Enabled=False";
mostCurrent._rcsettings.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 576;BA.debugLine="vbat.Enabled=False";
mostCurrent._vbat.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 577;BA.debugLine="tri.Enabled=False";
mostCurrent._tri.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 578;BA.debugLine="gimbal.Enabled=False";
mostCurrent._gimbal.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 579;BA.debugLine="Misc.Enabled=False";
mostCurrent._misc.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 580;BA.debugLine="read_again.Enabled=False";
mostCurrent._read_again.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 581;BA.debugLine="Set_Features.Enabled=False";
mostCurrent._set_features.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 582;BA.debugLine="Baud.Enabled=False";
mostCurrent._baud.setEnabled(anywheresoftware.b4a.keywords.Common.False);
 //BA.debugLineNum = 583;BA.debugLine="End Sub";
return "";
}
public static String  _direccion_click() throws Exception{
 //BA.debugLineNum = 729;BA.debugLine="Sub direccion_click";
 //BA.debugLineNum = 730;BA.debugLine="If yawdir.Checked Then";
if (mostCurrent._yawdir.getChecked()) { 
 //BA.debugLineNum = 731;BA.debugLine="valor=1";
_valor = (int)(1);
 }else {
 //BA.debugLineNum = 733;BA.debugLine="valor =-1";
_valor = (int)(-1);
 };
 //BA.debugLineNum = 735;BA.debugLine="End Sub";
return "";
}
public static String  _gimbal_click() throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
int _i = 0;
anywheresoftware.b4a.objects.ButtonWrapper _cerrar4 = null;
 //BA.debugLineNum = 436;BA.debugLine="Sub gimbal_Click()";
 //BA.debugLineNum = 437;BA.debugLine="deshabilitar";
_deshabilitar();
 //BA.debugLineNum = 439;BA.debugLine="panel_gimbal.Initialize(\"\")";
mostCurrent._panel_gimbal.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 440;BA.debugLine="Activity.addview(panel_gimbal,0%x, 0%y, 100%x, 100%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._panel_gimbal.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(100),mostCurrent.activityBA));
 //BA.debugLineNum = 441;BA.debugLine="Dim titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 442;BA.debugLine="titulo.Initialize(\"\")";
_titulo.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 443;BA.debugLine="titulo.text= \"Gimbal Settings\"";
_titulo.setText((Object)("Gimbal Settings"));
 //BA.debugLineNum = 444;BA.debugLine="titulo.TextSize=18";
_titulo.setTextSize((float)(18));
 //BA.debugLineNum = 445;BA.debugLine="titulo.gravity=Gravity.CENTER";
_titulo.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 446;BA.debugLine="panel_gimbal.AddView(titulo, 50%x,0%y, 100%x,10%y)";
mostCurrent._panel_gimbal.AddView((android.view.View)(_titulo.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 447;BA.debugLine="titulo.Left=50%x-titulo.Width/2";
_titulo.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_titulo.getWidth()/(double)2));
 //BA.debugLineNum = 448;BA.debugLine="panel_gimbal.Color=Colors.ARGB(255,0,0,0)";
mostCurrent._panel_gimbal.setColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int)(255),(int)(0),(int)(0),(int)(0)));
 //BA.debugLineNum = 449;BA.debugLine="For i=0 To 8";
{
final double step316 = 1;
final double limit316 = (int)(8);
for (_i = (int)(0); (step316 > 0 && _i <= limit316) || (step316 < 0 && _i >= limit316); _i += step316) {
 //BA.debugLineNum = 450;BA.debugLine="labeltext(i).Initialize(\"\")";
mostCurrent._labeltext[_i].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 451;BA.debugLine="labelvalue(i+20).Initialize(\"labelvalue\")";
mostCurrent._labelvalue[(int)(_i+20)].Initialize(mostCurrent.activityBA,"labelvalue");
 //BA.debugLineNum = 452;BA.debugLine="labeltext(i).Text=set_label.Get(i+20)";
mostCurrent._labeltext[_i].setText(mostCurrent._set_label.Get((int)(_i+20)));
 //BA.debugLineNum = 453;BA.debugLine="labelvalue(i+20).Text=sets(i+20)";
mostCurrent._labelvalue[(int)(_i+20)].setText((Object)(_sets[(int)(_i+20)]));
 //BA.debugLineNum = 454;BA.debugLine="labelvalue(i+20).Tag=set_label.get(i+20)";
mostCurrent._labelvalue[(int)(_i+20)].setTag(mostCurrent._set_label.Get((int)(_i+20)));
 //BA.debugLineNum = 455;BA.debugLine="labelvalue(i+20).Color=Colors.White";
mostCurrent._labelvalue[(int)(_i+20)].setColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 456;BA.debugLine="labelvalue(i+20).TextColor=Colors.Black";
mostCurrent._labelvalue[(int)(_i+20)].setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 457;BA.debugLine="panel_gimbal.AddView(labeltext(i),5%x, 10%y+i*8%y,50%x,40dip)";
mostCurrent._panel_gimbal.AddView((android.view.View)(mostCurrent._labeltext[_i].getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(8),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 458;BA.debugLine="panel_gimbal.AddView(labelvalue(i+20),10%x+labeltext(i).Width, 10%y+i*8%y,50dip,30dip)";
mostCurrent._panel_gimbal.AddView((android.view.View)(mostCurrent._labelvalue[(int)(_i+20)].getObject()),(int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(10),mostCurrent.activityBA)+mostCurrent._labeltext[_i].getWidth()),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(8),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(30)));
 //BA.debugLineNum = 459;BA.debugLine="labelvalue(i+20).Gravity=Gravity.CENTER";
mostCurrent._labelvalue[(int)(_i+20)].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 460;BA.debugLine="labeltext(i).Gravity=Gravity.CENTER";
mostCurrent._labeltext[_i].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 }
};
 //BA.debugLineNum = 462;BA.debugLine="Dim cerrar4 As Button";
_cerrar4 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 463;BA.debugLine="cerrar4.Initialize(\"cerrar4\")";
_cerrar4.Initialize(mostCurrent.activityBA,"cerrar4");
 //BA.debugLineNum = 464;BA.debugLine="cerrar4.Text=\"Close\"";
_cerrar4.setText((Object)("Close"));
 //BA.debugLineNum = 465;BA.debugLine="panel_gimbal.AddView(cerrar4,50%x,90%y,100dip,40dip)";
mostCurrent._panel_gimbal.AddView((android.view.View)(_cerrar4.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(90),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(100)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 466;BA.debugLine="cerrar4.Left=50%x-cerrar4.Width/2";
_cerrar4.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_cerrar4.getWidth()/(double)2));
 //BA.debugLineNum = 467;BA.debugLine="cerrar4.Gravity=Gravity.CENTER";
_cerrar4.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 469;BA.debugLine="End Sub";
return "";
}

public static void initializeProcessGlobals() {
     main.initializeProcessGlobals();
}
public static String  _globals() throws Exception{
 //BA.debugLineNum = 8;BA.debugLine="Sub Globals";
 //BA.debugLineNum = 11;BA.debugLine="Dim yawdir As ToggleButton";
mostCurrent._yawdir = new anywheresoftware.b4a.objects.CompoundButtonWrapper.ToggleButtonWrapper();
 //BA.debugLineNum = 12;BA.debugLine="Dim cli_connected As Boolean";
_cli_connected = false;
 //BA.debugLineNum = 13;BA.debugLine="Dim labels As Label";
mostCurrent._labels = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 14;BA.debugLine="Dim timer2 As Timer";
mostCurrent._timer2 = new anywheresoftware.b4a.objects.Timer();
 //BA.debugLineNum = 15;BA.debugLine="timer2.Initialize(\"Timer2\", 200)";
mostCurrent._timer2.Initialize(processBA,"Timer2",(long)(200));
 //BA.debugLineNum = 16;BA.debugLine="Dim checkboxes(10) As CheckBox";
mostCurrent._checkboxes = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper[(int)(10)];
{
int d0 = mostCurrent._checkboxes.length;
for (int i0 = 0;i0 < d0;i0++) {
mostCurrent._checkboxes[i0] = new anywheresoftware.b4a.objects.CompoundButtonWrapper.CheckBoxWrapper();
}
}
;
 //BA.debugLineNum = 17;BA.debugLine="Dim features(10) As String";
mostCurrent._features = new String[(int)(10)];
java.util.Arrays.fill(mostCurrent._features,"");
 //BA.debugLineNum = 18;BA.debugLine="features= Array As String (\"PPM\", \"VBAT\", \"INFLIGHT_ACC_CAL\",\"SPEKTRUM\", \"MOTOR_STOP\",\"SERVO_TILT\",\"CAMTRIG\",\"GYRO_SMOOTHING\",\"LED_RING\",\"GPS\")";
mostCurrent._features = new String[]{"PPM","VBAT","INFLIGHT_ACC_CAL","SPEKTRUM","MOTOR_STOP","SERVO_TILT","CAMTRIG","GYRO_SMOOTHING","LED_RING","GPS"};
 //BA.debugLineNum = 19;BA.debugLine="Dim Set_Features As Button";
mostCurrent._set_features = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 20;BA.debugLine="Dim vsv As Panel 'ScrollView";
mostCurrent._vsv = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 21;BA.debugLine="Dim lbl2 As Label";
mostCurrent._lbl2 = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 22;BA.debugLine="Dim sk1 As SeekBar";
mostCurrent._sk1 = new anywheresoftware.b4a.objects.SeekBarWrapper();
 //BA.debugLineNum = 23;BA.debugLine="Dim cd As CustomDialog";
mostCurrent._cd = new anywheresoftware.b4a.agraham.dialogs.InputDialog.CustomDialog();
 //BA.debugLineNum = 24;BA.debugLine="Dim valor As Int";
_valor = 0;
 //BA.debugLineNum = 25;BA.debugLine="Dim sets(50) As Int";
_sets = new int[(int)(50)];
;
 //BA.debugLineNum = 26;BA.debugLine="Dim cuantos As Int";
_cuantos = 0;
 //BA.debugLineNum = 27;BA.debugLine="Dim set_label As List";
mostCurrent._set_label = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 29;BA.debugLine="Dim rcsettings As Button";
mostCurrent._rcsettings = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 30;BA.debugLine="Dim changed(50) As Boolean 'deadband=0, yawdeadband=1,";
_changed = new boolean[(int)(50)];
;
 //BA.debugLineNum = 31;BA.debugLine="Dim labeltext(50) As Label";
mostCurrent._labeltext = new anywheresoftware.b4a.objects.LabelWrapper[(int)(50)];
{
int d0 = mostCurrent._labeltext.length;
for (int i0 = 0;i0 < d0;i0++) {
mostCurrent._labeltext[i0] = new anywheresoftware.b4a.objects.LabelWrapper();
}
}
;
 //BA.debugLineNum = 32;BA.debugLine="Dim labelvalue(50) As Label";
mostCurrent._labelvalue = new anywheresoftware.b4a.objects.LabelWrapper[(int)(50)];
{
int d0 = mostCurrent._labelvalue.length;
for (int i0 = 0;i0 < d0;i0++) {
mostCurrent._labelvalue[i0] = new anywheresoftware.b4a.objects.LabelWrapper();
}
}
;
 //BA.debugLineNum = 33;BA.debugLine="Dim Maxs(33) As Int";
_maxs = new int[(int)(33)];
;
 //BA.debugLineNum = 34;BA.debugLine="Dim Mins(33) As Int";
_mins = new int[(int)(33)];
;
 //BA.debugLineNum = 35;BA.debugLine="Maxs= Array As Int (32,32,1700,2000,2000,2000,2000,2000,498,498,1,200,50,50,   1,2000,2000,2000,2000,2000,255, 100, 100,3000,3000,3000,3000,3000,3000,250,256,115200,115200)";
_maxs = new int[]{(int)(32),(int)(32),(int)(1700),(int)(2000),(int)(2000),(int)(2000),(int)(2000),(int)(2000),(int)(498),(int)(498),(int)(1),(int)(200),(int)(50),(int)(50),(int)(1),(int)(2000),(int)(2000),(int)(2000),(int)(2000),(int)(2000),(int)(255),(int)(100),(int)(100),(int)(3000),(int)(3000),(int)(3000),(int)(3000),(int)(3000),(int)(3000),(int)(250),(int)(256),(int)(115200),(int)(115200)};
 //BA.debugLineNum = 36;BA.debugLine="Mins= Array As Int ( 0, 0,1200,   0,   0,   0,   0,   0, 50, 50,0, 10,10,10,  -1,   0,   0,   0,   0,   0,  0,-100,-100, 100, 100, 100, 100, 100, 100,  0,  0,  1200,  1200)";
_mins = new int[]{(int)(0),(int)(0),(int)(1200),(int)(0),(int)(0),(int)(0),(int)(0),(int)(0),(int)(50),(int)(50),(int)(0),(int)(10),(int)(10),(int)(10),(int)(-1),(int)(0),(int)(0),(int)(0),(int)(0),(int)(0),(int)(0),(int)(-100),(int)(-100),(int)(100),(int)(100),(int)(100),(int)(100),(int)(100),(int)(100),(int)(0),(int)(0),(int)(1200),(int)(1200)};
 //BA.debugLineNum = 37;BA.debugLine="Dim valor_minimo As Int";
_valor_minimo = 0;
 //BA.debugLineNum = 38;BA.debugLine="Dim valor_maximo As Int";
_valor_maximo = 0;
 //BA.debugLineNum = 39;BA.debugLine="Dim vbat As Button";
mostCurrent._vbat = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 40;BA.debugLine="Dim read_again As Button";
mostCurrent._read_again = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 125;BA.debugLine="Dim panel_rc_settings As Panel";
mostCurrent._panel_rc_settings = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 126;BA.debugLine="Dim panel_vbat As Panel";
mostCurrent._panel_vbat = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 127;BA.debugLine="Dim panel_tri As Panel";
mostCurrent._panel_tri = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 128;BA.debugLine="Dim panel_gimbal As Panel";
mostCurrent._panel_gimbal = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 129;BA.debugLine="Dim panel_misc As Panel";
mostCurrent._panel_misc = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 130;BA.debugLine="Dim panel_baud As Panel";
mostCurrent._panel_baud = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 132;BA.debugLine="Dim gimbal As Button";
mostCurrent._gimbal = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 133;BA.debugLine="Dim tri As Button";
mostCurrent._tri = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 134;BA.debugLine="Dim Misc As Button";
mostCurrent._misc = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 135;BA.debugLine="Dim Baud As Button";
mostCurrent._baud = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 136;BA.debugLine="End Sub";
return "";
}
public static String  _habilitar() throws Exception{
 //BA.debugLineNum = 564;BA.debugLine="Sub habilitar";
 //BA.debugLineNum = 565;BA.debugLine="rcsettings.Enabled=True";
mostCurrent._rcsettings.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 566;BA.debugLine="vbat.Enabled=True";
mostCurrent._vbat.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 567;BA.debugLine="tri.Enabled=True";
mostCurrent._tri.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 568;BA.debugLine="gimbal.Enabled=True";
mostCurrent._gimbal.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 569;BA.debugLine="Misc.Enabled=True";
mostCurrent._misc.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 570;BA.debugLine="read_again.Enabled=True";
mostCurrent._read_again.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 571;BA.debugLine="Set_Features.Enabled=True";
mostCurrent._set_features.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 572;BA.debugLine="Baud.Enabled=True";
mostCurrent._baud.setEnabled(anywheresoftware.b4a.keywords.Common.True);
 //BA.debugLineNum = 573;BA.debugLine="End Sub";
return "";
}
public static String  _labelvalue_click() throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _who = null;
 //BA.debugLineNum = 661;BA.debugLine="Sub labelvalue_click";
 //BA.debugLineNum = 662;BA.debugLine="Dim who As Label";
_who = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 663;BA.debugLine="who=Sender";
_who.setObject((android.widget.TextView)(anywheresoftware.b4a.keywords.Common.Sender(mostCurrent.activityBA)));
 //BA.debugLineNum = 664;BA.debugLine="popup(who.text,who.Tag)";
_popup((int)(Double.parseDouble(_who.getText())),String.valueOf(_who.getTag()));
 //BA.debugLineNum = 665;BA.debugLine="changed(set_label.IndexOf(who.Tag))=True";
_changed[mostCurrent._set_label.IndexOf(_who.getTag())] = anywheresoftware.b4a.keywords.Common.True;
 //BA.debugLineNum = 666;BA.debugLine="End Sub";
return "";
}
public static String  _misc_click() throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
int _i = 0;
anywheresoftware.b4a.objects.ButtonWrapper _cerrar5 = null;
 //BA.debugLineNum = 470;BA.debugLine="Sub misc_Click()";
 //BA.debugLineNum = 471;BA.debugLine="deshabilitar";
_deshabilitar();
 //BA.debugLineNum = 473;BA.debugLine="panel_misc.Initialize(\"\")";
mostCurrent._panel_misc.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 474;BA.debugLine="Activity.addview(panel_misc,0%x, 0%y, 100%x, 100%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._panel_misc.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(100),mostCurrent.activityBA));
 //BA.debugLineNum = 475;BA.debugLine="Dim titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 476;BA.debugLine="titulo.Initialize(\"\")";
_titulo.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 477;BA.debugLine="titulo.text= \"Misc Settings\"";
_titulo.setText((Object)("Misc Settings"));
 //BA.debugLineNum = 478;BA.debugLine="titulo.TextSize=18";
_titulo.setTextSize((float)(18));
 //BA.debugLineNum = 479;BA.debugLine="titulo.gravity=Gravity.CENTER";
_titulo.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 480;BA.debugLine="panel_misc.AddView(titulo, 50%x,0%y, 100%x,10%y)";
mostCurrent._panel_misc.AddView((android.view.View)(_titulo.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 481;BA.debugLine="titulo.Left=50%x-titulo.Width/2";
_titulo.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_titulo.getWidth()/(double)2));
 //BA.debugLineNum = 482;BA.debugLine="panel_misc.Color=Colors.ARGB(255,0,0,0)";
mostCurrent._panel_misc.setColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int)(255),(int)(0),(int)(0),(int)(0)));
 //BA.debugLineNum = 483;BA.debugLine="For i=0 To 1";
{
final double step348 = 1;
final double limit348 = (int)(1);
for (_i = (int)(0); (step348 > 0 && _i <= limit348) || (step348 < 0 && _i >= limit348); _i += step348) {
 //BA.debugLineNum = 484;BA.debugLine="labeltext(i).Initialize(\"\")";
mostCurrent._labeltext[_i].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 485;BA.debugLine="labeltext(i).Text=set_label.Get(i+8)";
mostCurrent._labeltext[_i].setText(mostCurrent._set_label.Get((int)(_i+8)));
 //BA.debugLineNum = 486;BA.debugLine="labeltext(i).Gravity=Gravity.CENTER";
mostCurrent._labeltext[_i].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 487;BA.debugLine="labelvalue(i+8).Initialize(\"labelvalue\")";
mostCurrent._labelvalue[(int)(_i+8)].Initialize(mostCurrent.activityBA,"labelvalue");
 //BA.debugLineNum = 488;BA.debugLine="labelvalue(i+8).Text=sets(i+8)";
mostCurrent._labelvalue[(int)(_i+8)].setText((Object)(_sets[(int)(_i+8)]));
 //BA.debugLineNum = 489;BA.debugLine="labelvalue(i+8).Tag=set_label.get(i+8)";
mostCurrent._labelvalue[(int)(_i+8)].setTag(mostCurrent._set_label.Get((int)(_i+8)));
 //BA.debugLineNum = 490;BA.debugLine="labelvalue(i+8).Color=Colors.White";
mostCurrent._labelvalue[(int)(_i+8)].setColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 491;BA.debugLine="labelvalue(i+8).TextColor=Colors.Black";
mostCurrent._labelvalue[(int)(_i+8)].setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 492;BA.debugLine="labelvalue(i+8).Gravity=Gravity.CENTER";
mostCurrent._labelvalue[(int)(_i+8)].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 493;BA.debugLine="panel_misc.AddView(labeltext(i),5%x, 10%y+i*10%y,50%x,40dip)";
mostCurrent._panel_misc.AddView((android.view.View)(mostCurrent._labeltext[_i].getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 494;BA.debugLine="panel_misc.AddView(labelvalue(i+8),10%x+labeltext(i).Width, 10%y+i*10%y,50dip,30dip)";
mostCurrent._panel_misc.AddView((android.view.View)(mostCurrent._labelvalue[(int)(_i+8)].getObject()),(int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(10),mostCurrent.activityBA)+mostCurrent._labeltext[_i].getWidth()),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(30)));
 }
};
 //BA.debugLineNum = 499;BA.debugLine="yawdir.Initialize(\"spektrum\")";
mostCurrent._yawdir.Initialize(mostCurrent.activityBA,"spektrum");
 //BA.debugLineNum = 500;BA.debugLine="yawdir.TextOff=\"0\"";
mostCurrent._yawdir.setTextOff("0");
 //BA.debugLineNum = 501;BA.debugLine="yawdir.TextOn=\"1\"";
mostCurrent._yawdir.setTextOn("1");
 //BA.debugLineNum = 502;BA.debugLine="If sets(10)=1 Then";
if (_sets[(int)(10)]==1) { 
 //BA.debugLineNum = 503;BA.debugLine="yawdir.Checked=True";
mostCurrent._yawdir.setChecked(anywheresoftware.b4a.keywords.Common.True);
 }else {
 //BA.debugLineNum = 505;BA.debugLine="yawdir.Checked=False";
mostCurrent._yawdir.setChecked(anywheresoftware.b4a.keywords.Common.False);
 };
 //BA.debugLineNum = 507;BA.debugLine="labeltext(2).Initialize(\"\")";
mostCurrent._labeltext[(int)(2)].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 508;BA.debugLine="labeltext(2).Text=set_label.Get(10)";
mostCurrent._labeltext[(int)(2)].setText(mostCurrent._set_label.Get((int)(10)));
 //BA.debugLineNum = 509;BA.debugLine="labeltext(2).Gravity=Gravity.CENTER";
mostCurrent._labeltext[(int)(2)].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 510;BA.debugLine="panel_misc.AddView(labeltext(2),5%x, 10%y+2*10%y,50%x,40dip)";
mostCurrent._panel_misc.AddView((android.view.View)(mostCurrent._labeltext[(int)(2)].getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)+2*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 511;BA.debugLine="panel_misc.AddView(yawdir,10%x+labeltext(2).Width, 30%y,50dip,50dip)";
mostCurrent._panel_misc.AddView((android.view.View)(mostCurrent._yawdir.getObject()),(int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(10),mostCurrent.activityBA)+mostCurrent._labeltext[(int)(2)].getWidth()),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(30),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)));
 //BA.debugLineNum = 513;BA.debugLine="Dim cerrar5 As Button";
_cerrar5 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 514;BA.debugLine="cerrar5.Initialize(\"cerrar5\")";
_cerrar5.Initialize(mostCurrent.activityBA,"cerrar5");
 //BA.debugLineNum = 515;BA.debugLine="cerrar5.Text=\"Close\"";
_cerrar5.setText((Object)("Close"));
 //BA.debugLineNum = 516;BA.debugLine="panel_misc.AddView(cerrar5,50%x,90%y,100dip,40dip)";
mostCurrent._panel_misc.AddView((android.view.View)(_cerrar5.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(90),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(100)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 517;BA.debugLine="cerrar5.Left=50%x-cerrar5.Width/2";
_cerrar5.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_cerrar5.getWidth()/(double)2));
 //BA.debugLineNum = 518;BA.debugLine="cerrar5.Gravity=Gravity.CENTER";
_cerrar5.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 520;BA.debugLine="End Sub";
return "";
}
public static String  _popup(int _inicial,String _quien) throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _who = null;
anywheresoftware.b4a.objects.PanelWrapper _pnl = null;
anywheresoftware.b4a.objects.drawable.ColorDrawable _bgnd = null;
String _a = "";
String _ret = "";
 //BA.debugLineNum = 677;BA.debugLine="Sub popup(inicial As Int, quien As String)";
 //BA.debugLineNum = 678;BA.debugLine="Dim who As Label";
_who = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 679;BA.debugLine="who=Sender";
_who.setObject((android.widget.TextView)(anywheresoftware.b4a.keywords.Common.Sender(mostCurrent.activityBA)));
 //BA.debugLineNum = 681;BA.debugLine="Dim pnl As Panel";
_pnl = new anywheresoftware.b4a.objects.PanelWrapper();
 //BA.debugLineNum = 682;BA.debugLine="pnl.Initialize(\"pnl\")";
_pnl.Initialize(mostCurrent.activityBA,"pnl");
 //BA.debugLineNum = 683;BA.debugLine="Dim bgnd As ColorDrawable";
_bgnd = new anywheresoftware.b4a.objects.drawable.ColorDrawable();
 //BA.debugLineNum = 684;BA.debugLine="bgnd.Initialize(Colors.Black, 5dip)";
_bgnd.Initialize(anywheresoftware.b4a.keywords.Common.Colors.Black,anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(5)));
 //BA.debugLineNum = 685;BA.debugLine="pnl.Background = bgnd";
_pnl.setBackground((android.graphics.drawable.Drawable)(_bgnd.getObject()));
 //BA.debugLineNum = 688;BA.debugLine="lbl2.Initialize(\"lbl2\")";
mostCurrent._lbl2.Initialize(mostCurrent.activityBA,"lbl2");
 //BA.debugLineNum = 689;BA.debugLine="sk1.Initialize(\"sk1\")";
mostCurrent._sk1.Initialize(mostCurrent.activityBA,"sk1");
 //BA.debugLineNum = 690;BA.debugLine="valor_minimo=Mins(set_label.IndexOf(quien))";
_valor_minimo = _mins[mostCurrent._set_label.IndexOf((Object)(_quien))];
 //BA.debugLineNum = 691;BA.debugLine="valor_maximo=Maxs(set_label.IndexOf(quien))";
_valor_maximo = _maxs[mostCurrent._set_label.IndexOf((Object)(_quien))];
 //BA.debugLineNum = 692;BA.debugLine="If Mins(set_label.IndexOf(quien))=0 Then";
if (_mins[mostCurrent._set_label.IndexOf((Object)(_quien))]==0) { 
 //BA.debugLineNum = 693;BA.debugLine="sk1.Max=Maxs(set_label.IndexOf(quien))";
mostCurrent._sk1.setMax(_maxs[mostCurrent._set_label.IndexOf((Object)(_quien))]);
 //BA.debugLineNum = 694;BA.debugLine="valor_maximo=sk1.Max";
_valor_maximo = mostCurrent._sk1.getMax();
 }else {
 //BA.debugLineNum = 696;BA.debugLine="sk1.Max=valor_maximo-valor_minimo";
mostCurrent._sk1.setMax((int)(_valor_maximo-_valor_minimo));
 };
 //BA.debugLineNum = 699;BA.debugLine="sk1.Value=inicial";
mostCurrent._sk1.setValue(_inicial);
 //BA.debugLineNum = 700;BA.debugLine="lbl2.Text=inicial";
mostCurrent._lbl2.setText((Object)(_inicial));
 //BA.debugLineNum = 702;BA.debugLine="pnl.AddView(sk1,5%x,10%y,70%x,25dip)";
_pnl.AddView((android.view.View)(mostCurrent._sk1.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(70),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(25)));
 //BA.debugLineNum = 703;BA.debugLine="lbl2.Gravity=Gravity.CENTER_HORIZONTAL";
mostCurrent._lbl2.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER_HORIZONTAL);
 //BA.debugLineNum = 704;BA.debugLine="pnl.AddView(lbl2,20%x,0%y,20%x,30dip)";
_pnl.AddView((android.view.View)(mostCurrent._lbl2.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(20),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(20),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(30)));
 //BA.debugLineNum = 706;BA.debugLine="cd.AddView(pnl, 0%x, 0%y, 80%x, 100dip) ' sizing relative to the screen size is probably best";
mostCurrent._cd.AddView((android.view.View)(_pnl.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(80),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(100)));
 //BA.debugLineNum = 707;BA.debugLine="If quien<>\"yaw_direction\" Then";
if ((_quien).equals("yaw_direction") == false) { 
 //BA.debugLineNum = 708;BA.debugLine="a= pnl.Width/2-lbl2.Width/2";
_a = BA.NumberToString(_pnl.getWidth()/(double)2-mostCurrent._lbl2.getWidth()/(double)2);
 //BA.debugLineNum = 709;BA.debugLine="lbl2.Left=a";
mostCurrent._lbl2.setLeft((int)(Double.parseDouble(_a)));
 };
 //BA.debugLineNum = 712;BA.debugLine="ret = cd.Show(\"\", \"Ok\", \"Cancel\", \"\", Null)";
_ret = BA.NumberToString(mostCurrent._cd.Show("","Ok","Cancel","",mostCurrent.activityBA,(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.Null)));
 //BA.debugLineNum = 713;BA.debugLine="If ret=DialogResponse.POSITIVE Then";
if ((_ret).equals(BA.NumberToString(anywheresoftware.b4a.keywords.Common.DialogResponse.POSITIVE))) { 
 //BA.debugLineNum = 714;BA.debugLine="labelvalue(set_label.IndexOf(who.Tag)).Text=valor";
mostCurrent._labelvalue[mostCurrent._set_label.IndexOf(_who.getTag())].setText((Object)(_valor));
 //BA.debugLineNum = 715;BA.debugLine="sets(set_label.IndexOf(who.Tag))=valor";
_sets[mostCurrent._set_label.IndexOf(_who.getTag())] = _valor;
 };
 //BA.debugLineNum = 719;BA.debugLine="End Sub";
return "";
}
public static String  _process_globals() throws Exception{
 //BA.debugLineNum = 2;BA.debugLine="Sub Process_Globals";
 //BA.debugLineNum = 5;BA.debugLine="Dim send_what As String";
_send_what = "";
 //BA.debugLineNum = 6;BA.debugLine="End Sub";
return "";
}
public static String  _rcsettings_click() throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
int _n = 0;
String _i = "";
anywheresoftware.b4a.objects.ButtonWrapper _cerrar = null;
 //BA.debugLineNum = 301;BA.debugLine="Sub rcsettings_Click";
 //BA.debugLineNum = 302;BA.debugLine="deshabilitar";
_deshabilitar();
 //BA.debugLineNum = 304;BA.debugLine="panel_rc_settings.Initialize(\"\")";
mostCurrent._panel_rc_settings.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 305;BA.debugLine="Activity.addview(panel_rc_settings,0%x, 0%y, 100%x, 100%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._panel_rc_settings.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(100),mostCurrent.activityBA));
 //BA.debugLineNum = 306;BA.debugLine="Dim titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 307;BA.debugLine="titulo.Initialize(\"\")";
_titulo.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 308;BA.debugLine="titulo.text= \"RC settings\"";
_titulo.setText((Object)("RC settings"));
 //BA.debugLineNum = 309;BA.debugLine="titulo.TextSize=18";
_titulo.setTextSize((float)(18));
 //BA.debugLineNum = 310;BA.debugLine="titulo.gravity=Gravity.CENTER";
_titulo.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 311;BA.debugLine="panel_rc_settings.AddView(titulo, 50%x,0%y, 100%x,10%y)";
mostCurrent._panel_rc_settings.AddView((android.view.View)(_titulo.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 312;BA.debugLine="titulo.Left=50%x-titulo.Width/2";
_titulo.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_titulo.getWidth()/(double)2));
 //BA.debugLineNum = 313;BA.debugLine="panel_rc_settings.Color=Colors.ARGB(255,0,0,0)";
mostCurrent._panel_rc_settings.setColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int)(255),(int)(0),(int)(0),(int)(0)));
 //BA.debugLineNum = 314;BA.debugLine="For n =0 To  3";
{
final double step196 = 1;
final double limit196 = (int)(3);
for (_n = (int)(0); (step196 > 0 && _n <= limit196) || (step196 < 0 && _n >= limit196); _n += step196) {
 //BA.debugLineNum = 315;BA.debugLine="i=2*n";
_i = BA.NumberToString(2*_n);
 //BA.debugLineNum = 316;BA.debugLine="labeltext(i).Initialize(\"\")";
mostCurrent._labeltext[(int)(Double.parseDouble(_i))].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 317;BA.debugLine="labelvalue(i).Initialize(\"labelvalue\")";
mostCurrent._labelvalue[(int)(Double.parseDouble(_i))].Initialize(mostCurrent.activityBA,"labelvalue");
 //BA.debugLineNum = 318;BA.debugLine="labeltext(i).Text=set_label.Get(i)";
mostCurrent._labeltext[(int)(Double.parseDouble(_i))].setText(mostCurrent._set_label.Get((int)(Double.parseDouble(_i))));
 //BA.debugLineNum = 319;BA.debugLine="labelvalue(i).Text=sets(i)";
mostCurrent._labelvalue[(int)(Double.parseDouble(_i))].setText((Object)(_sets[(int)(Double.parseDouble(_i))]));
 //BA.debugLineNum = 320;BA.debugLine="labelvalue(i).Tag=set_label.get(i)";
mostCurrent._labelvalue[(int)(Double.parseDouble(_i))].setTag(mostCurrent._set_label.Get((int)(Double.parseDouble(_i))));
 //BA.debugLineNum = 321;BA.debugLine="labelvalue(i).Color=Colors.White";
mostCurrent._labelvalue[(int)(Double.parseDouble(_i))].setColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 322;BA.debugLine="labelvalue(i).TextColor=Colors.Black";
mostCurrent._labelvalue[(int)(Double.parseDouble(_i))].setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 323;BA.debugLine="panel_rc_settings.AddView(labeltext(i),5%x, 20%y+n*10%y,80dip,40dip)";
mostCurrent._panel_rc_settings.AddView((android.view.View)(mostCurrent._labeltext[(int)(Double.parseDouble(_i))].getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(20),mostCurrent.activityBA)+_n*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(80)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 324;BA.debugLine="panel_rc_settings.AddView(labelvalue(i),5%x+labeltext(i).Width, 20%y+n*10%y,50dip,30dip)";
mostCurrent._panel_rc_settings.AddView((android.view.View)(mostCurrent._labelvalue[(int)(Double.parseDouble(_i))].getObject()),(int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA)+mostCurrent._labeltext[(int)(Double.parseDouble(_i))].getWidth()),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(20),mostCurrent.activityBA)+_n*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(30)));
 //BA.debugLineNum = 325;BA.debugLine="labelvalue(i).Gravity=Gravity.CENTER";
mostCurrent._labelvalue[(int)(Double.parseDouble(_i))].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 326;BA.debugLine="labeltext(i).Gravity=Gravity.CENTER";
mostCurrent._labeltext[(int)(Double.parseDouble(_i))].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 328;BA.debugLine="labeltext(i+1).Initialize(\"\")";
mostCurrent._labeltext[(int)((double)(Double.parseDouble(_i))+1)].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 329;BA.debugLine="labelvalue(i+1).Initialize(\"labelvalue\")";
mostCurrent._labelvalue[(int)((double)(Double.parseDouble(_i))+1)].Initialize(mostCurrent.activityBA,"labelvalue");
 //BA.debugLineNum = 330;BA.debugLine="labeltext(i+1).Text=set_label.Get(i+1)";
mostCurrent._labeltext[(int)((double)(Double.parseDouble(_i))+1)].setText(mostCurrent._set_label.Get((int)((double)(Double.parseDouble(_i))+1)));
 //BA.debugLineNum = 331;BA.debugLine="labelvalue(i+1).Text=sets(i+1)";
mostCurrent._labelvalue[(int)((double)(Double.parseDouble(_i))+1)].setText((Object)(_sets[(int)((double)(Double.parseDouble(_i))+1)]));
 //BA.debugLineNum = 332;BA.debugLine="labelvalue(i+1).Tag=set_label.get(i+1)";
mostCurrent._labelvalue[(int)((double)(Double.parseDouble(_i))+1)].setTag(mostCurrent._set_label.Get((int)((double)(Double.parseDouble(_i))+1)));
 //BA.debugLineNum = 333;BA.debugLine="labelvalue(i+1).Color=Colors.White";
mostCurrent._labelvalue[(int)((double)(Double.parseDouble(_i))+1)].setColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 334;BA.debugLine="labelvalue(i+1).TextColor=Colors.Black";
mostCurrent._labelvalue[(int)((double)(Double.parseDouble(_i))+1)].setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 335;BA.debugLine="panel_rc_settings.AddView(labeltext(i+1),55%x, 20%y+n*10%y,80dip,40dip)";
mostCurrent._panel_rc_settings.AddView((android.view.View)(mostCurrent._labeltext[(int)((double)(Double.parseDouble(_i))+1)].getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(55),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(20),mostCurrent.activityBA)+_n*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(80)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 336;BA.debugLine="panel_rc_settings.AddView(labelvalue(i+1),55%x+labeltext(i+1).Width, 20%y+n*10%y,50dip,30dip)";
mostCurrent._panel_rc_settings.AddView((android.view.View)(mostCurrent._labelvalue[(int)((double)(Double.parseDouble(_i))+1)].getObject()),(int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(55),mostCurrent.activityBA)+mostCurrent._labeltext[(int)((double)(Double.parseDouble(_i))+1)].getWidth()),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(20),mostCurrent.activityBA)+_n*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(30)));
 //BA.debugLineNum = 337;BA.debugLine="labelvalue(i+1).Gravity=Gravity.CENTER";
mostCurrent._labelvalue[(int)((double)(Double.parseDouble(_i))+1)].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 338;BA.debugLine="labeltext(i+1).Gravity=Gravity.CENTER";
mostCurrent._labeltext[(int)((double)(Double.parseDouble(_i))+1)].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 }
};
 //BA.debugLineNum = 340;BA.debugLine="Dim cerrar As Button";
_cerrar = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 341;BA.debugLine="cerrar.Initialize(\"cerrar\")";
_cerrar.Initialize(mostCurrent.activityBA,"cerrar");
 //BA.debugLineNum = 342;BA.debugLine="cerrar.Text=\"Close\"";
_cerrar.setText((Object)("Close"));
 //BA.debugLineNum = 343;BA.debugLine="panel_rc_settings.AddView(cerrar,50%x,90%y,100dip,40dip)";
mostCurrent._panel_rc_settings.AddView((android.view.View)(_cerrar.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(90),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(100)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 344;BA.debugLine="cerrar.Left=50%x-cerrar.Width/2";
_cerrar.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_cerrar.getWidth()/(double)2));
 //BA.debugLineNum = 345;BA.debugLine="cerrar.Gravity=Gravity.CENTER";
_cerrar.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 346;BA.debugLine="End Sub";
return "";
}
public static String  _read_again_click() throws Exception{
 //BA.debugLineNum = 298;BA.debugLine="Sub read_again_Click";
 //BA.debugLineNum = 299;BA.debugLine="data";
_data();
 //BA.debugLineNum = 300;BA.debugLine="End Sub";
return "";
}
public static String  _read_click() throws Exception{
String _fi = "";
anywheresoftware.b4a.agraham.dialogs.InputDialog.FileDialog _fd = null;
int _ret = 0;
anywheresoftware.b4a.objects.streams.File.TextReaderWrapper _tr = null;
anywheresoftware.b4a.objects.collections.List _listdata = null;
int _i = 0;
 //BA.debugLineNum = 263;BA.debugLine="Sub read_click";
 //BA.debugLineNum = 264;BA.debugLine="Dim fi As String";
_fi = "";
 //BA.debugLineNum = 265;BA.debugLine="Dim fd As FileDialog";
_fd = new anywheresoftware.b4a.agraham.dialogs.InputDialog.FileDialog();
 //BA.debugLineNum = 266;BA.debugLine="Dim ret As Int";
_ret = 0;
 //BA.debugLineNum = 268;BA.debugLine="fd.FileFilter=\".snaz\"";
_fd.setFileFilter(".snaz");
 //BA.debugLineNum = 269;BA.debugLine="File.MakeDir(\"/mnt/sdcard\",\"nazecontrol\")";
anywheresoftware.b4a.keywords.Common.File.MakeDir("/mnt/sdcard","nazecontrol");
 //BA.debugLineNum = 270;BA.debugLine="fd.FilePath=\"/mnt/sdcard/nazecontrol\"";
_fd.setFilePath("/mnt/sdcard/nazecontrol");
 //BA.debugLineNum = 271;BA.debugLine="If File.Exists(fd.FilePath, fi) = True Then";
if (anywheresoftware.b4a.keywords.Common.File.Exists(_fd.getFilePath(),_fi)==anywheresoftware.b4a.keywords.Common.True) { 
 //BA.debugLineNum = 273;BA.debugLine="ret = fd.Show(\"Read\" & fi, \"Read\",\"\",\"Cancel\", Null)";
_ret = _fd.Show("Read"+_fi,"Read","","Cancel",mostCurrent.activityBA,(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.Null));
 //BA.debugLineNum = 274;BA.debugLine="If ret = -2 Then";
if (_ret==-2) { 
 //BA.debugLineNum = 275;BA.debugLine="Return ' \"Don't save\" was pressed.";
if (true) return "";
 }else {
 //BA.debugLineNum = 277;BA.debugLine="Dim TR As TextReader";
_tr = new anywheresoftware.b4a.objects.streams.File.TextReaderWrapper();
 //BA.debugLineNum = 278;BA.debugLine="TR.Initialize(File.OpenInput(fd.FilePath, fd.ChosenName))";
_tr.Initialize((java.io.InputStream)(anywheresoftware.b4a.keywords.Common.File.OpenInput(_fd.getFilePath(),_fd.getChosenName()).getObject()));
 //BA.debugLineNum = 279;BA.debugLine="Dim listdata As List";
_listdata = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 280;BA.debugLine="listdata.Initialize";
_listdata.Initialize();
 //BA.debugLineNum = 281;BA.debugLine="listdata=TR.ReadList";
_listdata = _tr.ReadList();
 };
 };
 //BA.debugLineNum = 284;BA.debugLine="For i=0 To 9";
{
final double step170 = 1;
final double limit170 = (int)(9);
for (_i = (int)(0); (step170 > 0 && _i <= limit170) || (step170 < 0 && _i >= limit170); _i += step170) {
 //BA.debugLineNum = 285;BA.debugLine="If listdata.Get(i)=\"1\" Then";
if ((_listdata.Get(_i)).equals((Object)("1"))) { 
 //BA.debugLineNum = 286;BA.debugLine="checkboxes(i).Checked=True";
mostCurrent._checkboxes[_i].setChecked(anywheresoftware.b4a.keywords.Common.True);
 }else {
 //BA.debugLineNum = 288;BA.debugLine="checkboxes(i).Checked=False";
mostCurrent._checkboxes[_i].setChecked(anywheresoftware.b4a.keywords.Common.False);
 };
 }
};
 //BA.debugLineNum = 291;BA.debugLine="For i=0 To sets.Length-1";
{
final double step177 = 1;
final double limit177 = (int)(_sets.length-1);
for (_i = (int)(0); (step177 > 0 && _i <= limit177) || (step177 < 0 && _i >= limit177); _i += step177) {
 //BA.debugLineNum = 292;BA.debugLine="sets(i)=listdata.Get(i+10)";
_sets[_i] = (int)(BA.ObjectToNumber(_listdata.Get((int)(_i+10))));
 }
};
 //BA.debugLineNum = 296;BA.debugLine="End Sub";
return "";
}
public static String  _save_click() throws Exception{
String _fi = "";
anywheresoftware.b4a.agraham.dialogs.InputDialog.FileDialog _fd = null;
int _ret = 0;
String _temp = "";
anywheresoftware.b4a.objects.streams.File.TextWriterWrapper _tw = null;
anywheresoftware.b4a.objects.collections.List _writelist = null;
int _i = 0;
 //BA.debugLineNum = 222;BA.debugLine="Sub save_click";
 //BA.debugLineNum = 223;BA.debugLine="Dim fi As String";
_fi = "";
 //BA.debugLineNum = 224;BA.debugLine="Dim fd As FileDialog";
_fd = new anywheresoftware.b4a.agraham.dialogs.InputDialog.FileDialog();
 //BA.debugLineNum = 225;BA.debugLine="Dim ret As Int";
_ret = 0;
 //BA.debugLineNum = 227;BA.debugLine="File.MakeDir(\"/mnt/sdcard\",\"nazecontrol\")";
anywheresoftware.b4a.keywords.Common.File.MakeDir("/mnt/sdcard","nazecontrol");
 //BA.debugLineNum = 228;BA.debugLine="fd.FilePath=\"/mnt/sdcard/nazecontrol\"";
_fd.setFilePath("/mnt/sdcard/nazecontrol");
 //BA.debugLineNum = 229;BA.debugLine="fd.FileFilter=\".snaz\"";
_fd.setFileFilter(".snaz");
 //BA.debugLineNum = 230;BA.debugLine="If File.Exists(fd.FilePath, fi) = True Then";
if (anywheresoftware.b4a.keywords.Common.File.Exists(_fd.getFilePath(),_fi)==anywheresoftware.b4a.keywords.Common.True) { 
 //BA.debugLineNum = 232;BA.debugLine="ret = fd.Show(\"Save\" & fi, \"Save\",\"\",\"Don't save\", Null)";
_ret = _fd.Show("Save"+_fi,"Save","","Don't save",mostCurrent.activityBA,(android.graphics.Bitmap)(anywheresoftware.b4a.keywords.Common.Null));
 //BA.debugLineNum = 233;BA.debugLine="If ret = -2 Then";
if (_ret==-2) { 
 //BA.debugLineNum = 234;BA.debugLine="Return ' \"Don't save\" was pressed.";
if (true) return "";
 }else {
 //BA.debugLineNum = 236;BA.debugLine="Dim temp As String";
_temp = "";
 //BA.debugLineNum = 237;BA.debugLine="temp=DateTime.time(DateTime.Now) & \"_\" & DateTime.Date(DateTime.Now)";
_temp = anywheresoftware.b4a.keywords.Common.DateTime.Time(anywheresoftware.b4a.keywords.Common.DateTime.getNow())+"_"+anywheresoftware.b4a.keywords.Common.DateTime.Date(anywheresoftware.b4a.keywords.Common.DateTime.getNow());
 //BA.debugLineNum = 238;BA.debugLine="temp=temp.Replace(\"/\", \"-\")";
_temp = _temp.replace("/","-");
 //BA.debugLineNum = 239;BA.debugLine="temp=temp.Replace(\":\",\"\")";
_temp = _temp.replace(":","");
 //BA.debugLineNum = 240;BA.debugLine="fi = fd.ChosenName & \" \" & temp";
_fi = _fd.getChosenName()+" "+_temp;
 //BA.debugLineNum = 241;BA.debugLine="If fi.EndsWith(\"snaz\") Then";
if (_fi.endsWith("snaz")) { 
 }else {
 //BA.debugLineNum = 243;BA.debugLine="fi=fi & \".snaz\"";
_fi = _fi+".snaz";
 };
 //BA.debugLineNum = 245;BA.debugLine="Dim TW As TextWriter";
_tw = new anywheresoftware.b4a.objects.streams.File.TextWriterWrapper();
 //BA.debugLineNum = 246;BA.debugLine="TW.Initialize(File.OpenOutput(fd.FilePath, fi, False))";
_tw.Initialize((java.io.OutputStream)(anywheresoftware.b4a.keywords.Common.File.OpenOutput(_fd.getFilePath(),_fi,anywheresoftware.b4a.keywords.Common.False).getObject()));
 //BA.debugLineNum = 247;BA.debugLine="Dim writelist As List";
_writelist = new anywheresoftware.b4a.objects.collections.List();
 //BA.debugLineNum = 248;BA.debugLine="writelist.Initialize";
_writelist.Initialize();
 //BA.debugLineNum = 249;BA.debugLine="For i= 0 To 9";
{
final double step138 = 1;
final double limit138 = (int)(9);
for (_i = (int)(0); (step138 > 0 && _i <= limit138) || (step138 < 0 && _i >= limit138); _i += step138) {
 //BA.debugLineNum = 250;BA.debugLine="If checkboxes(i).Checked=True Then";
if (mostCurrent._checkboxes[_i].getChecked()==anywheresoftware.b4a.keywords.Common.True) { 
 //BA.debugLineNum = 251;BA.debugLine="writelist.Add(1)";
_writelist.Add((Object)(1));
 }else {
 //BA.debugLineNum = 253;BA.debugLine="writelist.Add(0)";
_writelist.Add((Object)(0));
 };
 }
};
 //BA.debugLineNum = 256;BA.debugLine="writelist.Addall(sets)";
_writelist.AddAll(anywheresoftware.b4a.keywords.Common.ArrayToList(_sets));
 //BA.debugLineNum = 257;BA.debugLine="TW.writelist(writelist)";
_tw.WriteList(_writelist);
 //BA.debugLineNum = 258;BA.debugLine="TW.Close";
_tw.Close();
 };
 };
 //BA.debugLineNum = 262;BA.debugLine="End Sub";
return "";
}
public static String  _set_features_click() throws Exception{
int _i = 0;
String _text = "";
String _seteo = "";
String _temp = "";
int _k = 0;
char[] _junk = null;
 //BA.debugLineNum = 744;BA.debugLine="Sub Set_Features_Click";
 //BA.debugLineNum = 745;BA.debugLine="If Main.connected Then";
if (mostCurrent._main._connected) { 
 //BA.debugLineNum = 746;BA.debugLine="For i= 0 To 9";
{
final double step575 = 1;
final double limit575 = (int)(9);
for (_i = (int)(0); (step575 > 0 && _i <= limit575) || (step575 < 0 && _i >= limit575); _i += step575) {
 //BA.debugLineNum = 747;BA.debugLine="If checkboxes(i).Checked Then";
if (mostCurrent._checkboxes[_i].getChecked()) { 
 //BA.debugLineNum = 748;BA.debugLine="Dim text As String";
_text = "";
 //BA.debugLineNum = 749;BA.debugLine="text=\"feature \" & features(i) & CRLF";
_text = "feature "+mostCurrent._features[_i]+anywheresoftware.b4a.keywords.Common.CRLF;
 //BA.debugLineNum = 750;BA.debugLine="Main.TextWriter1.Write(text)";
mostCurrent._main._textwriter1.Write(_text);
 //BA.debugLineNum = 751;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 }else {
 //BA.debugLineNum = 753;BA.debugLine="Dim text As String";
_text = "";
 //BA.debugLineNum = 754;BA.debugLine="text=\"feature -\" & features(i) & CRLF";
_text = "feature -"+mostCurrent._features[_i]+anywheresoftware.b4a.keywords.Common.CRLF;
 //BA.debugLineNum = 755;BA.debugLine="Main.TextWriter1.Write(text)";
mostCurrent._main._textwriter1.Write(_text);
 //BA.debugLineNum = 756;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 };
 }
};
 //BA.debugLineNum = 759;BA.debugLine="For i=0 To changed.Length-1";
{
final double step588 = 1;
final double limit588 = (int)(_changed.length-1);
for (_i = (int)(0); (step588 > 0 && _i <= limit588) || (step588 < 0 && _i >= limit588); _i += step588) {
 //BA.debugLineNum = 760;BA.debugLine="If changed(i) Then";
if (_changed[_i]) { 
 //BA.debugLineNum = 761;BA.debugLine="Dim text,seteo,temp As String";
_text = "";
_seteo = "";
_temp = "";
 //BA.debugLineNum = 762;BA.debugLine="temp=\"\"";
_temp = "";
 //BA.debugLineNum = 763;BA.debugLine="seteo= set_label.get(i)";
_seteo = String.valueOf(mostCurrent._set_label.Get(_i));
 //BA.debugLineNum = 764;BA.debugLine="For k=0 To seteo.Length-1";
{
final double step593 = 1;
final double limit593 = (int)(_seteo.length()-1);
for (_k = (int)(0); (step593 > 0 && _k <= limit593) || (step593 < 0 && _k >= limit593); _k += step593) {
 //BA.debugLineNum = 765;BA.debugLine="If seteo.CharAt(k) <> \" \" Then";
if (_seteo.charAt(_k)!=BA.ObjectToChar(" ")) { 
 //BA.debugLineNum = 766;BA.debugLine="temp=temp & seteo.CharAt(k)";
_temp = _temp+String.valueOf(_seteo.charAt(_k));
 }else {
 };
 }
};
 //BA.debugLineNum = 770;BA.debugLine="text=\"set \" & temp & \" = \" &  sets(i) & CRLF";
_text = "set "+_temp+" = "+BA.NumberToString(_sets[_i])+anywheresoftware.b4a.keywords.Common.CRLF;
 //BA.debugLineNum = 771;BA.debugLine="Main.TextWriter1.Write(text)";
mostCurrent._main._textwriter1.Write(_text);
 //BA.debugLineNum = 772;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 };
 }
};
 //BA.debugLineNum = 776;BA.debugLine="Dim junk(1000) As Char";
_junk = new char[(int)(1000)];
;
 //BA.debugLineNum = 777;BA.debugLine="Main.TextReader1.read(junk,0,1000)";
mostCurrent._main._textreader1.Read(_junk,(int)(0),(int)(1000));
 };
 //BA.debugLineNum = 783;BA.debugLine="End Sub";
return "";
}
public static String  _sk1_valuechanged(int _value,boolean _userchanged) throws Exception{
 //BA.debugLineNum = 720;BA.debugLine="Sub sk1_ValueChanged (Value As Int, UserChanged As Boolean)";
 //BA.debugLineNum = 721;BA.debugLine="If valor_minimo=0 Then";
if (_valor_minimo==0) { 
 //BA.debugLineNum = 722;BA.debugLine="valor=sk1.Value";
_valor = mostCurrent._sk1.getValue();
 //BA.debugLineNum = 723;BA.debugLine="lbl2.Text=sk1.Value";
mostCurrent._lbl2.setText((Object)(mostCurrent._sk1.getValue()));
 }else {
 //BA.debugLineNum = 725;BA.debugLine="valor=valor_minimo+sk1.Value";
_valor = (int)(_valor_minimo+mostCurrent._sk1.getValue());
 //BA.debugLineNum = 726;BA.debugLine="lbl2.Text=valor_minimo+sk1.Value";
mostCurrent._lbl2.setText((Object)(_valor_minimo+mostCurrent._sk1.getValue()));
 };
 //BA.debugLineNum = 728;BA.debugLine="End Sub";
return "";
}
public static String  _specktrum_click() throws Exception{
 //BA.debugLineNum = 736;BA.debugLine="Sub specktrum_click";
 //BA.debugLineNum = 737;BA.debugLine="If yawdir.Checked Then";
if (mostCurrent._yawdir.getChecked()) { 
 //BA.debugLineNum = 738;BA.debugLine="valor=1";
_valor = (int)(1);
 }else {
 //BA.debugLineNum = 740;BA.debugLine="valor =0";
_valor = (int)(0);
 };
 //BA.debugLineNum = 742;BA.debugLine="End Sub";
return "";
}
public static String  _spinners_itemclick(int _position,Object _value) throws Exception{
anywheresoftware.b4a.objects.SpinnerWrapper _who = null;
 //BA.debugLineNum = 609;BA.debugLine="Sub Spinners_ItemClick (Position As Int, Value As Object)";
 //BA.debugLineNum = 610;BA.debugLine="Dim who As Spinner";
_who = new anywheresoftware.b4a.objects.SpinnerWrapper();
 //BA.debugLineNum = 611;BA.debugLine="who=Sender";
_who.setObject((anywheresoftware.b4a.objects.SpinnerWrapper.B4ASpinner)(anywheresoftware.b4a.keywords.Common.Sender(mostCurrent.activityBA)));
 //BA.debugLineNum = 612;BA.debugLine="sets(set_label.IndexOf(who.Tag))=who.SelectedItem";
_sets[mostCurrent._set_label.IndexOf(_who.getTag())] = (int)(Double.parseDouble(_who.getSelectedItem()));
 //BA.debugLineNum = 613;BA.debugLine="changed(set_label.IndexOf(who.Tag))=True";
_changed[mostCurrent._set_label.IndexOf(_who.getTag())] = anywheresoftware.b4a.keywords.Common.True;
 //BA.debugLineNum = 614;BA.debugLine="End Sub";
return "";
}
public static String  _timer2_tick() throws Exception{
String _output = "";
char[] _buff = null;
int _i = 0;
String _c = "";
int _value = 0;
int _hasta = 0;
int _m = 0;
int _b = 0;
String _test = "";
int _h = 0;
 //BA.debugLineNum = 789;BA.debugLine="Sub Timer2_Tick";
 //BA.debugLineNum = 790;BA.debugLine="If Main.TextReader1.Ready Then 'check if there is any data waiting to be read";
if (mostCurrent._main._textreader1.Ready()) { 
 //BA.debugLineNum = 791;BA.debugLine="Dim output As String";
_output = "";
 //BA.debugLineNum = 794;BA.debugLine="Select send_what";
switch (BA.switchObjectToInt(_send_what,"start","feature","set")) {
case 0:
 //BA.debugLineNum = 796;BA.debugLine="Dim buff(100) As Char";
_buff = new char[(int)(100)];
;
 //BA.debugLineNum = 797;BA.debugLine="cuantos=Main.TextReader1.read(buff,0,buff.length)";
_cuantos = mostCurrent._main._textreader1.Read(_buff,(int)(0),_buff.length);
 //BA.debugLineNum = 798;BA.debugLine="output=CharsToString(buff,0,buff.Length)";
_output = anywheresoftware.b4a.keywords.Common.CharsToString(_buff,(int)(0),_buff.length);
 break;
case 1:
 //BA.debugLineNum = 800;BA.debugLine="Dim buff(250) As Char";
_buff = new char[(int)(250)];
;
 //BA.debugLineNum = 801;BA.debugLine="cuantos= cuantos + Main.TextReader1.read(buff,0,buff.length)";
_cuantos = (int)(_cuantos+mostCurrent._main._textreader1.Read(_buff,(int)(0),_buff.length));
 //BA.debugLineNum = 802;BA.debugLine="output=CharsToString(buff,0,buff.Length)";
_output = anywheresoftware.b4a.keywords.Common.CharsToString(_buff,(int)(0),_buff.length);
 //BA.debugLineNum = 803;BA.debugLine="For i=0 To 9";
{
final double step623 = 1;
final double limit623 = (int)(9);
for (_i = (int)(0); (step623 > 0 && _i <= limit623) || (step623 < 0 && _i >= limit623); _i += step623) {
 //BA.debugLineNum = 804;BA.debugLine="If output.Contains(features(i))=True Then";
if (_output.contains(mostCurrent._features[_i])==anywheresoftware.b4a.keywords.Common.True) { 
 //BA.debugLineNum = 805;BA.debugLine="checkboxes(i).Checked=True";
mostCurrent._checkboxes[_i].setChecked(anywheresoftware.b4a.keywords.Common.True);
 };
 }
};
 break;
case 2:
 //BA.debugLineNum = 809;BA.debugLine="Dim buff(1000) As Char";
_buff = new char[(int)(1000)];
;
 //BA.debugLineNum = 810;BA.debugLine="c= Main.TextReader1.read(buff,0,buff.length)";
_c = BA.NumberToString(mostCurrent._main._textreader1.Read(_buff,(int)(0),_buff.length));
 //BA.debugLineNum = 811;BA.debugLine="output=CharsToString(buff,0,buff.Length)";
_output = anywheresoftware.b4a.keywords.Common.CharsToString(_buff,(int)(0),_buff.length);
 //BA.debugLineNum = 812;BA.debugLine="Dim value As Int";
_value = 0;
 //BA.debugLineNum = 813;BA.debugLine="Dim hasta As Int";
_hasta = 0;
 //BA.debugLineNum = 814;BA.debugLine="If output.Contains(\"Current settings:\") Then";
if (_output.contains("Current settings:")) { 
 //BA.debugLineNum = 816;BA.debugLine="For m=0 To set_label.Size-1";
{
final double step635 = 1;
final double limit635 = (int)(mostCurrent._set_label.getSize()-1);
for (_m = (int)(0); (step635 > 0 && _m <= limit635) || (step635 < 0 && _m >= limit635); _m += step635) {
 //BA.debugLineNum = 817;BA.debugLine="Dim B As Int";
_b = 0;
 //BA.debugLineNum = 818;BA.debugLine="Dim test As String";
_test = "";
 //BA.debugLineNum = 819;BA.debugLine="test=set_label.Get(m)";
_test = String.valueOf(mostCurrent._set_label.Get(_m));
 //BA.debugLineNum = 820;BA.debugLine="test=test.ToLowerCase";
_test = _test.toLowerCase();
 //BA.debugLineNum = 821;BA.debugLine="test=test.Replace(\" \",\"\")";
_test = _test.replace(" ","");
 //BA.debugLineNum = 822;BA.debugLine="B=output.IndexOf(test)";
_b = _output.indexOf(_test);
 //BA.debugLineNum = 823;BA.debugLine="If  B <> -1 Then";
if (_b!=-1) { 
 //BA.debugLineNum = 824;BA.debugLine="For i= B + test.Length To B + test.Length + 10";
{
final double step643 = 1;
final double limit643 = (int)(_b+_test.length()+10);
for (_i = (int)(_b+_test.length()); (step643 > 0 && _i <= limit643) || (step643 < 0 && _i >= limit643); _i += step643) {
 //BA.debugLineNum = 825;BA.debugLine="If buff(i)=\"=\" Then";
if (_buff[_i]==BA.ObjectToChar("=")) { 
 //BA.debugLineNum = 826;BA.debugLine="For h=1 To 10";
{
final double step645 = 1;
final double limit645 = (int)(10);
for (_h = (int)(1); (step645 > 0 && _h <= limit645) || (step645 < 0 && _h >= limit645); _h += step645) {
 //BA.debugLineNum = 827;BA.debugLine="If buff(i+h)=Chr(10) Then";
if (_buff[(int)(_i+_h)]==anywheresoftware.b4a.keywords.Common.Chr((int)(10))) { 
 //BA.debugLineNum = 828;BA.debugLine="hasta=h";
_hasta = _h;
 };
 }
};
 //BA.debugLineNum = 831;BA.debugLine="Try";
try { //BA.debugLineNum = 832;BA.debugLine="sets(m)=CharsToString(buff,i+1, hasta)";
_sets[_m] = (int)(Double.parseDouble(anywheresoftware.b4a.keywords.Common.CharsToString(_buff,(int)(_i+1),_hasta)));
 } 
       catch (Exception e) {
			processBA.setLastException(e); //BA.debugLineNum = 834;BA.debugLine="Main.TextWriter1.Write(\"set\" & CRLF)";
mostCurrent._main._textwriter1.Write("set"+anywheresoftware.b4a.keywords.Common.CRLF);
 //BA.debugLineNum = 835;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 };
 };
 }
};
 }else {
 //BA.debugLineNum = 841;BA.debugLine="sets(m)= -1000";
_sets[_m] = (int)(-1000);
 };
 }
};
 }else {
 //BA.debugLineNum = 846;BA.debugLine="Main.TextWriter1.Write(\"set\" & CRLF)";
mostCurrent._main._textwriter1.Write("set"+anywheresoftware.b4a.keywords.Common.CRLF);
 //BA.debugLineNum = 847;BA.debugLine="Main.TextWriter1.Flush";
mostCurrent._main._textwriter1.Flush();
 };
 break;
}
;
 };
 //BA.debugLineNum = 859;BA.debugLine="End Sub";
return "";
}
public static String  _tri_click() throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
int _i = 0;
anywheresoftware.b4a.objects.ButtonWrapper _cerrar3 = null;
 //BA.debugLineNum = 382;BA.debugLine="Sub tri_Click()";
 //BA.debugLineNum = 383;BA.debugLine="deshabilitar";
_deshabilitar();
 //BA.debugLineNum = 385;BA.debugLine="panel_tri.Initialize(\"\")";
mostCurrent._panel_tri.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 386;BA.debugLine="Activity.addview(panel_tri,0%x, 0%y, 100%x, 100%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._panel_tri.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(100),mostCurrent.activityBA));
 //BA.debugLineNum = 387;BA.debugLine="Dim titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 388;BA.debugLine="titulo.Initialize(\"\")";
_titulo.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 389;BA.debugLine="titulo.text= \"Tri/Wing Settings\"";
_titulo.setText((Object)("Tri/Wing Settings"));
 //BA.debugLineNum = 390;BA.debugLine="titulo.TextSize=18";
_titulo.setTextSize((float)(18));
 //BA.debugLineNum = 391;BA.debugLine="titulo.gravity=Gravity.CENTER";
_titulo.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 392;BA.debugLine="panel_tri.AddView(titulo, 50%x,0%y, 100%x,10%y)";
mostCurrent._panel_tri.AddView((android.view.View)(_titulo.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 393;BA.debugLine="titulo.Left=50%x-titulo.Width/2";
_titulo.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_titulo.getWidth()/(double)2));
 //BA.debugLineNum = 394;BA.debugLine="panel_tri.Color=Colors.ARGB(255,0,0,0)";
mostCurrent._panel_tri.setColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int)(255),(int)(0),(int)(0),(int)(0)));
 //BA.debugLineNum = 395;BA.debugLine="For i=0 To 5";
{
final double step272 = 1;
final double limit272 = (int)(5);
for (_i = (int)(0); (step272 > 0 && _i <= limit272) || (step272 < 0 && _i >= limit272); _i += step272) {
 //BA.debugLineNum = 396;BA.debugLine="labeltext(i).Initialize(\"\")";
mostCurrent._labeltext[_i].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 397;BA.debugLine="labeltext(i).Text=set_label.Get(i+14)";
mostCurrent._labeltext[_i].setText(mostCurrent._set_label.Get((int)(_i+14)));
 //BA.debugLineNum = 398;BA.debugLine="panel_tri.AddView(labeltext(i),5%x, 20%y+i*10%y,50%x,40dip)";
mostCurrent._panel_tri.AddView((android.view.View)(mostCurrent._labeltext[_i].getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(20),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 400;BA.debugLine="If i<>0 Then";
if (_i!=0) { 
 //BA.debugLineNum = 401;BA.debugLine="labelvalue(i+14).Initialize(\"labelvalue\")";
mostCurrent._labelvalue[(int)(_i+14)].Initialize(mostCurrent.activityBA,"labelvalue");
 //BA.debugLineNum = 402;BA.debugLine="labelvalue(i+14).Text=sets(i+14)";
mostCurrent._labelvalue[(int)(_i+14)].setText((Object)(_sets[(int)(_i+14)]));
 //BA.debugLineNum = 403;BA.debugLine="labelvalue(i+14).Tag=set_label.get(i+14)";
mostCurrent._labelvalue[(int)(_i+14)].setTag(mostCurrent._set_label.Get((int)(_i+14)));
 //BA.debugLineNum = 404;BA.debugLine="labelvalue(i+14).Color=Colors.White";
mostCurrent._labelvalue[(int)(_i+14)].setColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 405;BA.debugLine="labelvalue(i+14).TextColor=Colors.Black";
mostCurrent._labelvalue[(int)(_i+14)].setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 406;BA.debugLine="labelvalue(i+14).Gravity=Gravity.CENTER";
mostCurrent._labelvalue[(int)(_i+14)].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 407;BA.debugLine="panel_tri.AddView(labelvalue(i+14),10%x+labeltext(i).Width, 20%y+i*10%y,50dip,30dip)";
mostCurrent._panel_tri.AddView((android.view.View)(mostCurrent._labelvalue[(int)(_i+14)].getObject()),(int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(10),mostCurrent.activityBA)+mostCurrent._labeltext[_i].getWidth()),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(20),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(30)));
 }else {
 //BA.debugLineNum = 410;BA.debugLine="yawdir.Initialize(\"direccion\")";
mostCurrent._yawdir.Initialize(mostCurrent.activityBA,"direccion");
 //BA.debugLineNum = 411;BA.debugLine="yawdir.TextOff=\"-1\"";
mostCurrent._yawdir.setTextOff("-1");
 //BA.debugLineNum = 412;BA.debugLine="yawdir.TextOn=\"1\"";
mostCurrent._yawdir.setTextOn("1");
 //BA.debugLineNum = 413;BA.debugLine="If sets(14)=1 Then";
if (_sets[(int)(14)]==1) { 
 //BA.debugLineNum = 414;BA.debugLine="yawdir.Checked=True";
mostCurrent._yawdir.setChecked(anywheresoftware.b4a.keywords.Common.True);
 }else {
 //BA.debugLineNum = 416;BA.debugLine="yawdir.Checked=False";
mostCurrent._yawdir.setChecked(anywheresoftware.b4a.keywords.Common.False);
 };
 //BA.debugLineNum = 418;BA.debugLine="panel_tri.AddView(yawdir,10%x+labeltext(i).Width, 20%y-20dip,50dip,50dip)";
mostCurrent._panel_tri.AddView((android.view.View)(mostCurrent._yawdir.getObject()),(int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(10),mostCurrent.activityBA)+mostCurrent._labeltext[_i].getWidth()),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(20),mostCurrent.activityBA)-anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(20))),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)));
 };
 //BA.debugLineNum = 424;BA.debugLine="labeltext(i).Gravity=Gravity.CENTER";
mostCurrent._labeltext[_i].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 }
};
 //BA.debugLineNum = 426;BA.debugLine="Dim cerrar3 As Button";
_cerrar3 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 427;BA.debugLine="cerrar3.Initialize(\"cerrar3\")";
_cerrar3.Initialize(mostCurrent.activityBA,"cerrar3");
 //BA.debugLineNum = 428;BA.debugLine="cerrar3.Text=\"Close\"";
_cerrar3.setText((Object)("Close"));
 //BA.debugLineNum = 429;BA.debugLine="panel_tri.AddView(cerrar3,50%x,90%y,100dip,40dip)";
mostCurrent._panel_tri.AddView((android.view.View)(_cerrar3.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(90),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(100)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 430;BA.debugLine="cerrar3.Left=50%x-cerrar3.Width/2";
_cerrar3.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_cerrar3.getWidth()/(double)2));
 //BA.debugLineNum = 431;BA.debugLine="cerrar3.Gravity=Gravity.CENTER";
_cerrar3.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 435;BA.debugLine="End Sub";
return "";
}
public static String  _vbat_click() throws Exception{
anywheresoftware.b4a.objects.LabelWrapper _titulo = null;
int _i = 0;
anywheresoftware.b4a.objects.ButtonWrapper _cerrar2 = null;
 //BA.debugLineNum = 347;BA.debugLine="Sub vbat_Click()";
 //BA.debugLineNum = 348;BA.debugLine="deshabilitar";
_deshabilitar();
 //BA.debugLineNum = 350;BA.debugLine="panel_vbat.Initialize(\"\")";
mostCurrent._panel_vbat.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 351;BA.debugLine="Activity.addview(panel_vbat,0%x, 0%y, 100%x, 100%y)";
mostCurrent._activity.AddView((android.view.View)(mostCurrent._panel_vbat.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(100),mostCurrent.activityBA));
 //BA.debugLineNum = 352;BA.debugLine="Dim titulo As Label";
_titulo = new anywheresoftware.b4a.objects.LabelWrapper();
 //BA.debugLineNum = 353;BA.debugLine="titulo.Initialize(\"\")";
_titulo.Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 354;BA.debugLine="titulo.text= \"Battery Settings\"";
_titulo.setText((Object)("Battery Settings"));
 //BA.debugLineNum = 355;BA.debugLine="titulo.TextSize=18";
_titulo.setTextSize((float)(18));
 //BA.debugLineNum = 356;BA.debugLine="titulo.gravity=Gravity.CENTER";
_titulo.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 357;BA.debugLine="panel_vbat.AddView(titulo, 50%x,0%y, 100%x,10%y)";
mostCurrent._panel_vbat.AddView((android.view.View)(_titulo.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(0),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(100),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA));
 //BA.debugLineNum = 358;BA.debugLine="titulo.Left=50%x-titulo.Width/2";
_titulo.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_titulo.getWidth()/(double)2));
 //BA.debugLineNum = 359;BA.debugLine="panel_vbat.Color=Colors.ARGB(255,0,0,0)";
mostCurrent._panel_vbat.setColor(anywheresoftware.b4a.keywords.Common.Colors.ARGB((int)(255),(int)(0),(int)(0),(int)(0)));
 //BA.debugLineNum = 360;BA.debugLine="For i=0 To 2";
{
final double step240 = 1;
final double limit240 = (int)(2);
for (_i = (int)(0); (step240 > 0 && _i <= limit240) || (step240 < 0 && _i >= limit240); _i += step240) {
 //BA.debugLineNum = 361;BA.debugLine="labeltext(i).Initialize(\"\")";
mostCurrent._labeltext[_i].Initialize(mostCurrent.activityBA,"");
 //BA.debugLineNum = 362;BA.debugLine="labelvalue(i+11).Initialize(\"labelvalue\")";
mostCurrent._labelvalue[(int)(_i+11)].Initialize(mostCurrent.activityBA,"labelvalue");
 //BA.debugLineNum = 363;BA.debugLine="labeltext(i).Text=set_label.Get(i+11)";
mostCurrent._labeltext[_i].setText(mostCurrent._set_label.Get((int)(_i+11)));
 //BA.debugLineNum = 364;BA.debugLine="labelvalue(i+11).Text=sets(i+11)";
mostCurrent._labelvalue[(int)(_i+11)].setText((Object)(_sets[(int)(_i+11)]));
 //BA.debugLineNum = 365;BA.debugLine="labelvalue(i+11).Tag=set_label.get(i+11)";
mostCurrent._labelvalue[(int)(_i+11)].setTag(mostCurrent._set_label.Get((int)(_i+11)));
 //BA.debugLineNum = 366;BA.debugLine="labelvalue(i+11).Color=Colors.White";
mostCurrent._labelvalue[(int)(_i+11)].setColor(anywheresoftware.b4a.keywords.Common.Colors.White);
 //BA.debugLineNum = 367;BA.debugLine="labelvalue(i+11).TextColor=Colors.Black";
mostCurrent._labelvalue[(int)(_i+11)].setTextColor(anywheresoftware.b4a.keywords.Common.Colors.Black);
 //BA.debugLineNum = 368;BA.debugLine="panel_vbat.AddView(labeltext(i),5%x, 20%y+i*10%y,50%x,40dip)";
mostCurrent._panel_vbat.AddView((android.view.View)(mostCurrent._labeltext[_i].getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(5),mostCurrent.activityBA),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(20),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 369;BA.debugLine="panel_vbat.AddView(labelvalue(i+11),10%x+labeltext(i).Width, 20%y+i*10%y,50dip,30dip)";
mostCurrent._panel_vbat.AddView((android.view.View)(mostCurrent._labelvalue[(int)(_i+11)].getObject()),(int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(10),mostCurrent.activityBA)+mostCurrent._labeltext[_i].getWidth()),(int)(anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(20),mostCurrent.activityBA)+_i*anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(10),mostCurrent.activityBA)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(50)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(30)));
 //BA.debugLineNum = 370;BA.debugLine="labelvalue(i+11).Gravity=Gravity.CENTER";
mostCurrent._labelvalue[(int)(_i+11)].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 371;BA.debugLine="labeltext(i).Gravity=Gravity.CENTER";
mostCurrent._labeltext[_i].setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 }
};
 //BA.debugLineNum = 373;BA.debugLine="Dim cerrar2 As Button";
_cerrar2 = new anywheresoftware.b4a.objects.ButtonWrapper();
 //BA.debugLineNum = 374;BA.debugLine="cerrar2.Initialize(\"cerrar2\")";
_cerrar2.Initialize(mostCurrent.activityBA,"cerrar2");
 //BA.debugLineNum = 375;BA.debugLine="cerrar2.Text=\"Close\"";
_cerrar2.setText((Object)("Close"));
 //BA.debugLineNum = 376;BA.debugLine="panel_vbat.AddView(cerrar2,50%x,90%y,100dip,40dip)";
mostCurrent._panel_vbat.AddView((android.view.View)(_cerrar2.getObject()),anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.PerYToCurrent((float)(90),mostCurrent.activityBA),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(100)),anywheresoftware.b4a.keywords.Common.DipToCurrent((int)(40)));
 //BA.debugLineNum = 377;BA.debugLine="cerrar2.Left=50%x-cerrar2.Width/2";
_cerrar2.setLeft((int)(anywheresoftware.b4a.keywords.Common.PerXToCurrent((float)(50),mostCurrent.activityBA)-_cerrar2.getWidth()/(double)2));
 //BA.debugLineNum = 378;BA.debugLine="cerrar2.Gravity=Gravity.CENTER";
_cerrar2.setGravity(anywheresoftware.b4a.keywords.Common.Gravity.CENTER);
 //BA.debugLineNum = 380;BA.debugLine="End Sub";
return "";
}
}
